Interface IAssetsStorage
Interface defining base functionality for asset storage operations in the WebReportDesigner system.
Namespace: Telerik.WebReportDesigner.Services
Assembly: Telerik.WebReportDesigner.Services.dll
Syntax
public interface IAssetsStorage
Remarks
Provides common storage operations for managing resources and folders, supporting both report definitions and other asset types. Implemented by various storage backends to enable consistent asset management across different storage mechanisms.
Methods
CreateFolderAsync(CreateFolderModel)
Creates a new folder in the specified parent location.
Declaration
Task<ResourceFolderModel> CreateFolderAsync(CreateFolderModel model)
Parameters
|
CreateFolderModel
model
The model containing the create operation data |
Returns
|
System.Threading.Tasks.Task<ResourceFolderModel>
The ResourceFolderModel of the newly created folder |
Remarks
Establishes a new directory structure within the storage system, enabling hierarchical organization of assets and supporting the folder creation operations in the Assets Manager.
DeleteAsync(String)
Deletes the resource at the specified URI.
Declaration
Task DeleteAsync(string uri)
Parameters
|
System.String
uri
The unique resource identifier (URI) |
Returns
|
System.Threading.Tasks.Task
|
Remarks
Removes the resource from the storage system permanently, supporting cleanup operations and manual resource management through the Assets Manager interface.
DeleteFolderAsync(String)
Deletes the folder at the specified URI.
Declaration
Task DeleteFolderAsync(string uri)
Parameters
|
System.String
uri
The unique resource identifier (URI) |
Returns
|
System.Threading.Tasks.Task
|
Remarks
Removes the folder and all its contents from the storage system, providing cleanup functionality for the Assets Manager and automated maintenance operations.
GetAsync(String)
Finds a resource by its name and returns its contents as a byte array.
Declaration
Task<byte[]> GetAsync(string resourceName)
Parameters
|
System.String
resourceName
The name of the resource to retrieve. |
Returns
|
System.Threading.Tasks.Task<System.Byte[]>
System.Threading.Tasks.Task<TResult>, where TResult is System.Byte[], containing the resource bytes. |
Remarks
Must throw a ReportNotFoundException when the requested resourceName represents a report definition and was not found. Must throw a ResourceNotFoundException when the requested resourceName represents a resource and was not found.
GetFolderAsync(String)
Retrieves the folder model at the specified URI or returns null if not found.
Declaration
Task<ResourceFolderModel> GetFolderAsync(string uri)
Parameters
|
System.String
uri
The unique resource identifier (URI). |
Returns
|
System.Threading.Tasks.Task<ResourceFolderModel>
The ResourceFolderModel of the obtained folder. |
Remarks
Provides folder metadata including name, parent relationships, and subfolder indicators for UI components that require folder information without loading the complete contents.
GetFolderContentsAsync(String)
Retrieves all resources contained in the specified folder.
Declaration
Task<IEnumerable<ResourceModelBase>> GetFolderContentsAsync(string uri)
Parameters
|
System.String
uri
The unique resource identifier (URI) of the folder |
Returns
|
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<ResourceModelBase>>
A list of all resources found in the folder as an enumerable of ResourceModelBase |
Remarks
Returns both files and subfolders within the specified directory, enabling hierarchical navigation and content listing in the Assets Manager interface.
GetModelAsync(String)
Retrieves the resource model at the specified URI or returns null if not found.
Declaration
Task<ResourceFileModel> GetModelAsync(string uri)
Parameters
|
System.String
uri
The unique resource identifier (URI) of the resource. |
Returns
|
System.Threading.Tasks.Task<ResourceFileModel>
ResourceFileModel, containing the information about the resource. |
Remarks
Provides complete resource metadata including size, timestamps, and path information for displaying in the Assets Manager and supporting resource management operations.
RenameAsync(RenameResourceModel)
Renames an existing resource to a new name.
Declaration
Task<ResourceFileModel> RenameAsync(RenameResourceModel model)
Parameters
|
RenameResourceModel
model
The model containing the rename operation data |
Returns
|
System.Threading.Tasks.Task<ResourceFileModel>
ResourceFileModel, containing the information about the renamed resource. |
Remarks
Updates the resource name while preserving its content and location, maintaining proper file extension validation and preventing naming conflicts within the storage system.
RenameFolderAsync(RenameFolderModel)
Renames an existing folder to a new name.
Declaration
Task<ResourceFolderModel> RenameFolderAsync(RenameFolderModel model)
Parameters
|
RenameFolderModel
model
The model containing the rename operation data |
Returns
|
System.Threading.Tasks.Task<ResourceFolderModel>
The ResourceFolderModel of the renamed folder |
Remarks
Updates the folder name while preserving its location and contents, maintaining all references and hierarchical relationships within the storage system.
SaveAsync(SaveResourceModel, Byte[])
Saves raw data as a new resource and returns its model information.
Declaration
Task<ResourceFileModel> SaveAsync(SaveResourceModel model, byte[] resource)
Parameters
|
SaveResourceModel
model
The model containing the save operation data. |
|
System.Byte[]
resource
The contents of the resource. |
Returns
|
System.Threading.Tasks.Task<ResourceFileModel>
ResourceFileModel, containing the information about the saved resource. |
Remarks
Persists the resource data to the storage system and creates the necessary directory structure if it doesn't exist, supporting upload operations and programmatic resource creation.