Class FileDefinitionStorage
File-based storage implementation for managing report definition files in the WebReportDesigner system.
Inheritance
Inherited Members
Namespace: Telerik.WebReportDesigner.Services
Assembly: Telerik.WebReportDesigner.Services.dll
Syntax
public class FileDefinitionStorage : FileDefinitionStorageBase, IResourceStorage, IHasBaseDir, IDefinitionStorage, IAssetsStorage
Remarks
Provides specialized functionality for storing and retrieving report definition files (.trdx, .trdp, .trbp) from a local directory structure, implementing the IDefinitionStorage interface for report management operations.
Constructors
FileDefinitionStorage(String)
Initializes a new instance of the FileDefinitionStorage class.
Declaration
public FileDefinitionStorage(string baseDir)
Parameters
|
System.String
baseDir
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
|
System.String
baseDir
The base directory where the report definitions are stored. |
|
System.String[]
excludedFolders
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
|
System.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
|
System.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
|
System.String
uri
The unique resource identifier (URI) of the definition. |
Returns
|
System.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
|
RenameResourceModel
model
The model containing relevant data used to rename. |
Returns
|
System.Threading.Tasks.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
|
SaveResourceModel
model
The save operation model containing name and location information. |
|
System.Byte[]
resource
The report definition content as a byte array. |
Returns
|
System.Threading.Tasks.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
|
System.String
definitionId
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.