Class ScreenPresetService
- Namespace
- Dynamicweb.CoreUI.Data.ScreenConfiguration
- Assembly
- Dynamicweb.CoreUI.dll
public abstract class ScreenPresetService
- Inheritance
-
ScreenPresetService
- Inherited Members
Methods
Delete(IEnumerable<long>)
Deletes the screen presets with the given ids and evicts them from the cache.
public abstract void Delete(IEnumerable<long> presetIds)
Parameters
presetIdsIEnumerable<long>The ids of the presets to delete.
GetAll()
Gets all screen presets.
public abstract IEnumerable<ScreenPreset> GetAll()
Returns
- IEnumerable<ScreenPreset>
Every cached ScreenPreset.
GetByColumnName(string)
Gets the screen presets that contain a configurable column with the given name.
public abstract IEnumerable<ScreenPreset> GetByColumnName(string columnName)
Parameters
columnNamestringThe configurable column name to match.
Returns
- IEnumerable<ScreenPreset>
The matching presets, or an empty sequence if the name is empty.
GetById(long)
Gets the screen preset with the specified id.
public abstract ScreenPreset? GetById(long id)
Parameters
idlongThe screen preset id.
Returns
- ScreenPreset
The matching ScreenPreset, or null if none exists.
GetByUser(User)
Gets every screen preset the user (or one of their groups) has access to, across all model types.
public abstract IEnumerable<ScreenPreset> GetByUser(User user)
Parameters
userUserThe user whose access is evaluated (built-in admins and angels see all presets).
Returns
- IEnumerable<ScreenPreset>
The presets the user may use.
GetByUserAndModel(Type, User)
Gets the screen presets for the given model type that are available to the user.
public abstract IEnumerable<ScreenPreset> GetByUserAndModel(Type modelType, User user)
Parameters
modelTypeTypeThe data model type the presets are bound to.
userUserThe user whose access is evaluated (built-in admins and angels see all presets for the model).
Returns
- IEnumerable<ScreenPreset>
The matching presets the user may use.
GetByUserAndScreenType(string, User)
Gets the screen presets available to the user for the data model bound to the given screen type.
public abstract IEnumerable<ScreenPreset> GetByUserAndScreenType(string screenTypeName, User user)
Parameters
screenTypeNamestringThe full name of the screen type whose data model the presets are bound to.
userUserThe user whose access is evaluated.
Returns
- IEnumerable<ScreenPreset>
The matching presets, or an empty sequence if the screen type has no data model.
GetDefaultForUser(string, User, string?)
Gets the user's default preset for a screen type (and optional subscreen).
public abstract ScreenPreset? GetDefaultForUser(string screenTypeName, User user, string? subscreenId)
Parameters
screenTypeNamestringThe full name of the screen type.
userUserThe user whose default (resolved across the user and their groups) is looked up.
subscreenIdstringThe subscreen id, or null/empty for the top-level screen.
Returns
- ScreenPreset
The default ScreenPreset, or null if none is set.
GetUserIds()
Gets the distinct user and group ids referenced by any screen preset.
public abstract IEnumerable<int> GetUserIds()
Returns
- IEnumerable<int>
The distinct user/group ids that have presets assigned.
GetUserSpecified(Type, User)
Gets the preset the user has explicitly selected for the screen type in the current session.
public abstract ScreenPreset? GetUserSpecified(Type screenType, User user)
Parameters
screenTypeTypeThe screen type.
userUserThe user (and their groups) whose session selection is looked up.
Returns
- ScreenPreset
The session-specific ScreenPreset, or null if the user has not selected one.
Save(ScreenPreset, ScreenPresetType?)
Saves a screen preset and updates the cache.
public abstract bool Save(ScreenPreset screenPreset, ScreenPresetType? type)
Parameters
screenPresetScreenPresetThe preset to save.
typeScreenPresetType?The aspect of the preset to persist, or null for the preset itself only.