Class StructureService
Service that provides access to the website's structure, including areas, elements, sections, and views.
Inheritance
Implements
Inherited Members
Namespace: DataWeb.Structure
Assembly: DataWeb.Core.dll
Syntax
public class StructureService : IStructureService
Constructors
StructureService(IAuthorizationService, IReflectionService, IAppErrorService, IServiceProvider, IAreaStore, IElementStore, ISectionStore, IViewStore)
Initializes a new instance of the StructureService class.
Declaration
public StructureService(IAuthorizationService authorizationService, IReflectionService reflectionService, IAppErrorService appErrorService, IServiceProvider serviceProvider, IAreaStore areaStore, IElementStore elementStore, ISectionStore sectionStore, IViewStore viewStore)
Parameters
Type | Name | Description |
---|---|---|
IAuthorizationService | authorizationService | The authorization service used to check user permissions. |
IReflectionService | reflectionService | The reflection service used to create module instances. |
IAppErrorService | appErrorService | The error service used to log exceptions. |
IServiceProvider | serviceProvider | The service provider used to create module instances. |
IAreaStore | areaStore | The store used to access area data. |
IElementStore | elementStore | The store used to access element data. |
ISectionStore | sectionStore | The store used to access section data. |
IViewStore | viewStore | The store used to access view data. |
Methods
GetAllAreasAsync()
Gets all areas in the system.
Declaration
public Task<IEnumerable<Area>> GetAllAreasAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<Area>> | An System.Collections.Generic.IEnumerable<T> of Area objects representing all areas in the system. |
GetAreaAsync(string)
Gets an area by its name.
Declaration
public Task<Area> GetAreaAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the area to retrieve. |
Returns
Type | Description |
---|---|
Task<Area> | An Area object representing the area with the specified name. |
GetElementAsync(string)
Gets an element with the specified name.
Declaration
public Task<Element> GetElementAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the element to retrieve. |
Returns
Type | Description |
---|---|
Task<Element> | An Element object representing the element with the specified name. |
GetElementsAsync()
Gets all elements.
Declaration
public Task<IEnumerable<Element>> GetElementsAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<Element>> | An System.Collections.Generic.IEnumerable<T> of Element objects representing all the elements. |
GetExplorerModuleAsync(Section, NavigationContext)
Retrieves the explorer module for the given section and navigation context
Declaration
public Task<ModuleBase> GetExplorerModuleAsync(Section section, NavigationContext navigationContext)
Parameters
Type | Name | Description |
---|---|---|
Section | section | The Section to retrieve the explorer module for |
NavigationContext | navigationContext | The NavigationContext for the explorer module |
Returns
Type | Description |
---|---|
Task<ModuleBase> | The explorer module for the given section and navigation context |
GetSectionAsync(string)
Gets a section with the specified name.
Declaration
public Task<Section> GetSectionAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the section to retrieve. |
Returns
Type | Description |
---|---|
Task<Section> | A Section object representing the section with the specified name. |
GetSectionsAsync()
Gets all sections.
Declaration
public Task<IEnumerable<Section>> GetSectionsAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<Section>> | An System.Collections.Generic.IEnumerable<T> of Section objects representing all the sections. |
GetUserAreasAsync(IUser)
Gets all areas visible to the specified user.
Declaration
public Task<IEnumerable<Area>> GetUserAreasAsync(IUser user)
Parameters
Type | Name | Description |
---|---|---|
IUser | user | The IUser for whom to retrieve areas. |
Returns
Type | Description |
---|---|
Task<IEnumerable<Area>> | An System.Collections.Generic.IEnumerable<T> of Area objects representing the areas visible to the user. |
GetViewAsync(string)
Retrieves a view with the given name from the view store
Declaration
public Task<View> GetViewAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
string | name | The name of the view to retrieve |
Returns
Type | Description |
---|---|
Task<View> | The view with the given name |
GetViewsAsync()
Retrieves all views from the view store
Declaration
public Task<IEnumerable<View>> GetViewsAsync()
Returns
Type | Description |
---|---|
Task<IEnumerable<View>> | A collection of all views in the view store |