File-based storage implementation for managing report definition files in the WebReportDesigner system.
Definition
Namespace:Telerik.WebReportDesigner.Services
Assembly:Telerik.WebReportDesigner.Services.dll
Syntax:
public class FileDefinitionStorage : FileDefinitionStorageBase, IResourceStorage, IDefinitionStorage, IAssetsStorage
Inheritance: objectResourceStorageBaseResourceStorageFileDefinitionStorageBaseFileDefinitionStorage
Implements:
Inherited Members
Constructors
Initializes a new instance of the FileDefinitionStorage class.
public FileDefinitionStorage(string baseDir, string[] excludedFolders)
The base directory where the report definitions are stored.
excludedFoldersstring[]Relative folder paths to be excluded when retrieving folder contents. Wildcards are not supported.
Creates a new storage instance with the ability to exclude specific folders from storage operations, useful for filtering system or temporary directories.
Initializes a new instance of the FileDefinitionStorage class.
public FileDefinitionStorage(string baseDir)
The base directory where the report definitions are stored.
Creates a new storage instance with default configuration, using the specified base directory for report definition files.
Fields
RootFolderName
string
The constant name of the Reports root folder.
public const string RootFolderName = "Reports"
Defines the default root folder name for report definitions in the storage hierarchy.
Properties
FileExtensions
string[]
Gets the array of allowed report definition file extensions.
protected override string[] FileExtensions { get; }
Overrides:
Returns the supported report file extensions (.trdx, .trdp, .trbp) for filtering and validation purposes.
Methods
GetByUri(string)
byte[]
Retrieves a report definition by its URI and returns the content as a byte array.
public override byte[] GetByUri(string uri)
The unique resource identifier (URI) of the definition.
Returns:byte[]
The report definition content as a byte array.
Overrides:
Loads the specified report definition file from the storage system, throwing ReportNotFoundException if the file is not found.
Renames a report definition file.
public override Task<ResourceFileModel> RenameAsync(RenameResourceModel model)
The model containing relevant data used to rename.
Returns:Task<ResourceFileModel>
A task representing the asynchronous rename operation with the updated resource model.
Overrides:
Implements:
Updates the report definition filename while preserving its content and location, throwing InvalidReportNameException for invalid names.
Creates a new or overwrites an existing report definition file with the provided content.
public override Task<ResourceFileModel> SaveAsync(SaveResourceModel model, byte[] resource)
The save operation model containing name and location information.
resourcebyte[]The report definition content as a byte array.
Returns:Task<ResourceFileModel>
A task representing the asynchronous save operation with the saved resource model.
Overrides:
Implements:
Persists the report definition to the file system, creating directories as needed and throwing ReportNotFoundException for invalid paths.
Validates the provided report definition identifier.
protected override void ValidateDefinitionId(string definitionId)
The definition identifier to validate.
Overrides:
Ensures the definition identifier meets the requirements for report definition naming conventions and throws validation exceptions for invalid identifiers.