using Oqtane.Models; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace Oqtane.Services { /// /// Service to manage s /// public interface ISettingService { /// /// Returns a key-value dictionary of all tenant settings /// /// Task> GetTenantSettingsAsync(); /// /// Updates a tenant setting /// /// /// Task UpdateTenantSettingsAsync(Dictionary tenantSettings); /// /// Returns a key-value dictionary of all site settings for the given site /// /// /// Task> GetSiteSettingsAsync(int siteId); /// /// Updates a site setting /// /// /// /// Task UpdateSiteSettingsAsync(Dictionary siteSettings, int siteId); /// /// Clears site option cache /// /// Task ClearSiteSettingsCacheAsync(); /// /// Returns a key-value dictionary of all page settings for the given page /// /// /// Task> GetPageSettingsAsync(int pageId); /// /// Updates a page setting /// /// /// /// Task UpdatePageSettingsAsync(Dictionary pageSettings, int pageId); /// /// Returns a key-value dictionary of all page module settings for the given page module /// /// /// Task> GetPageModuleSettingsAsync(int pageModuleId); /// /// Updates a page module setting /// /// /// /// Task UpdatePageModuleSettingsAsync(Dictionary pageModuleSettings, int pageModuleId); /// /// Returns a key-value dictionary of all module settings for the given module /// /// /// Task> GetModuleSettingsAsync(int moduleId); /// /// Updates a module setting /// /// /// /// Task UpdateModuleSettingsAsync(Dictionary moduleSettings, int moduleId); /// /// Returns a key-value dictionary of all module settings for the given module /// /// /// Task> GetModuleDefinitionSettingsAsync(int moduleDefinitionId); /// /// Updates a module setting /// /// /// /// Task UpdateModuleDefinitionSettingsAsync(Dictionary moduleDefinitionSettings, int moduleDefinitionId); /// /// Returns a key-value dictionary of all user settings for the given user /// /// /// Task> GetUserSettingsAsync(int userId); /// /// Updates a user setting /// /// /// /// Task UpdateUserSettingsAsync(Dictionary userSettings, int userId); /// /// Returns a key-value dictionary of all folder settings for the given folder /// /// /// Task> GetFolderSettingsAsync(int folderId); /// /// Updates a folder setting /// /// /// /// Task UpdateFolderSettingsAsync(Dictionary folderSettings, int folderId); /// /// Returns a key-value dictionary of all tenant settings /// /// Task> GetHostSettingsAsync(); /// /// Updates a host setting /// /// /// Task UpdateHostSettingsAsync(Dictionary hostSettings); /// /// Returns a key-value dictionary of all settings for the given visitor /// /// /// Task> GetVisitorSettingsAsync(int visitorId); /// /// Updates a visitor setting /// /// /// /// Task UpdateVisitorSettingsAsync(Dictionary visitorSettings, int visitorId); /// /// Returns a key-value dictionary of all settings for the given entityName /// /// /// Task> GetSettingsAsync(string entityName, int entityId); /// /// Updates settings for a given entityName and Id /// /// /// /// /// Task UpdateSettingsAsync(Dictionary settings, string entityName, int entityId); /// /// Returns a specific setting /// /// /// /// /// Task DeleteSettingAsync(string entityName, int entityId, string settingName); /// /// Returns a specific setting /// /// /// /// /// Task> GetSettingsAsync(string entityName, int entityId, string settingName); /// /// Returns a specific setting /// /// /// Task GetSettingAsync(string entityName, int settingId); /// /// Creates a new setting /// /// /// Task AddSettingAsync(Setting setting); /// /// Updates a existing setting /// /// /// Task UpdateSettingAsync(Setting setting); /// /// Deletes a setting /// /// /// Task DeleteSettingAsync(string entityName, int settingId); /// /// Gets the value of the given settingName (key) from the given key-value dictionary /// /// /// /// /// string GetSetting(Dictionary settings, string settingName, string defaultValue); /// /// Sets the value of the given settingName (key) in the given key-value dictionary /// /// /// /// /// Dictionary SetSetting(Dictionary settings, string settingName, string settingValue); Dictionary SetSetting(Dictionary settings, string settingName, string settingValue, bool isPrivate); Dictionary MergeSettings(Dictionary settings1, Dictionary settings2); [Obsolete("GetSettingAsync(int settingId) is deprecated. Use GetSettingAsync(string entityName, int settingId) instead.", false)] Task GetSettingAsync(int settingId); [Obsolete("DeleteSettingAsync(int settingId) is deprecated. Use DeleteSettingAsync(string entityName, int settingId) instead.", false)] Task DeleteSettingAsync(int settingId); } }