ClassFileDefinitionStorage
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
FileDefinitionStorage(string)
Initializes a new instance of the FileDefinitionStorage class.
Declaration
public FileDefinitionStorage(string baseDir)
Parameters
baseDir
string
The base directory where the report definitions are stored.
Remarks
Creates a new storage instance with default configuration, using the specified base directory for report definition files.
FileDefinitionStorage(string, string[])
Initializes a new instance of the FileDefinitionStorage class.
Declaration
public FileDefinitionStorage(string baseDir, string[] excludedFolders)
Parameters
baseDir
string
The base directory where the report definitions are stored.
excludedFolders
string[]
Relative folder paths to be excluded when retrieving folder contents. Wildcards are not supported.
Remarks
Creates a new storage instance with the ability to exclude specific folders from storage operations, useful for filtering system or temporary directories.
Fields
RootFolderName
The constant name of the Reports root folder.
Declaration
public const string RootFolderName = "Reports"
Field Value
string
Remarks
Defines the default root folder name for report definitions in the storage hierarchy.
Properties
FileExtensions
Gets the array of allowed report definition file extensions.
Declaration
protected override string[] FileExtensions { get; }
Property Value
string[]
Overrides
Remarks
Returns the supported report file extensions (.trdx, .trdp, .trbp) for filtering and validation purposes.
Methods
GetByUri(string)
Retrieves a report definition by its URI and returns the content as a byte array.
Declaration
public override byte[] GetByUri(string uri)
Parameters
uri
string
The unique resource identifier (URI) of the definition.
Returns
byte[]
The report definition content as a byte array.
Overrides
Remarks
Loads the specified report definition file from the storage system, throwing ReportNotFoundException if the file is not found.
RenameAsync(RenameResourceModel)
Renames a report definition file.
Declaration
public override Task<ResourceFileModel> RenameAsync(RenameResourceModel model)
Parameters
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
Remarks
Updates the report definition filename while preserving its content and location, throwing InvalidReportNameException for invalid names.
SaveAsync(SaveResourceModel, byte[])
Creates a new or overwrites an existing report definition file with the provided content.
Declaration
public override Task<ResourceFileModel> SaveAsync(SaveResourceModel model, byte[] resource)
Parameters
model
The save operation model containing name and location information.
resource
byte[]
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
Remarks
Persists the report definition to the file system, creating directories as needed and throwing ReportNotFoundException for invalid paths.
ValidateDefinitionId(string)
Validates the provided report definition identifier.
Declaration
protected override void ValidateDefinitionId(string definitionId)
Parameters
definitionId
string
The definition identifier to validate.
Overrides
Remarks
Ensures the definition identifier meets the requirements for report definition naming conventions and throws validation exceptions for invalid identifiers.