File-based storage implementation for managing shared data source definition files in the WebReportDesigner system.
Definition
Namespace:Telerik.WebReportDesigner.Services
Assembly:Telerik.WebReportDesigner.Services.dll
Syntax:
public class FileSharedDataSourceStorage : FileDefinitionStorageBase, ISharedDataSourceStorage, IResourceStorage, IAssetsStorage
Inheritance: objectResourceStorageBaseResourceStorageFileDefinitionStorageBaseFileSharedDataSourceStorage
Implements:
Inherited Members
Constructors
Initializes a new instance of the FileSharedDataSourceStorage class with folder exclusions.
public FileSharedDataSourceStorage(string baseDir, string[] definitionFolders, string[] excludedFolders)
The base directory where the SharedDataSource definitions are stored.
definitionFoldersstring[]The folders where the SharedDataSource definitions are stored. Pass an empty string array to include all the folders.
excludedFoldersstring[]Relative folder paths to be excluded when retrieving folder contents. Wildcards are not supported.
Creates a new shared data source storage instance with the ability to exclude specific folders from operations, useful for filtering system or temporary directories.
Initializes a new instance of the FileSharedDataSourceStorage class with specific definition folders.
public FileSharedDataSourceStorage(string baseDir, string[] definitionFolders)
The base directory where the SharedDataSource subfolders are stored.
definitionFoldersstring[]The folders where the SharedDataSource definitions are stored. Pass an empty string array to include all the folders.
Creates a new shared data source storage instance with specific folder configuration for organizing shared data source files.
Initializes a new instance of the FileSharedDataSourceStorage class.
public FileSharedDataSourceStorage(string baseDir)
The base directory where the SharedDataSource definitions are stored.
Creates a new shared data source storage instance with default configuration, using the specified base directory for shared data source files.
Properties
FileExtensions
string[]
Gets the array of allowed shared data source file extensions.
protected override string[] FileExtensions { get; }
Overrides:
Returns the supported shared data source file extensions (.sdsx, .sdsp) for filtering and validation purposes.
Methods
Finds a shared data source resource by its URI and returns the information about it with description.
public override Task<ResourceFileModel> GetModelAsync(string uri)
The unique resource identifier (URI)
Returns:Task<ResourceFileModel>
A task representing the asynchronous operation with the SharedDataSourceModel containing resource information.
Overrides:
Implements:
Automatically extracts and sets the description from the shared data source file content for complete metadata information.
Determines if the provided resource extension is valid for shared data sources.
protected override bool IsExtensionValid(string resourceExtension)
The file extension to validate.
Returns:bool
True if the extension is valid for shared data sources, false otherwise.
Overrides:
Validates that the extension is one of the supported shared data source formats (.sdsx, .sdsp).
Moves a shared data source resource to a new parent location.
public override ResourceFileModel Move(MoveResourceModel model)
The model containing the move operation data
Returns:The SharedDataSourceModel containing information about the moved resource.
Overrides:
Implements:
Relocates the shared data source file while preserving its content and automatically updating the description metadata.
Overwrites an existing shared data source definition file with new content.
public override ResourceFileModel Overwrite(OverwriteResourceModel model, byte[] resource)
The model containing overwrite operation data.
resourcebyte[]The new shared data source definition content as a byte array.
Returns:The SharedDataSourceModel containing information about the overwritten resource.
Overrides:
Implements:
Validates the resource URI and automatically extracts the description from the new shared data source content.
Renames a shared data source definition file.
public override Task<ResourceFileModel> RenameAsync(RenameResourceModel model)
The model containing rename operation data.
Returns:Task<ResourceFileModel>
A task representing the asynchronous rename operation with the updated resource model.
Overrides:
Implements:
Validates the new name for shared data source naming conventions and automatically updates the description metadata.
Saves shared data source content and returns the resource information with extracted description.
public override Task<ResourceFileModel> SaveAsync(SaveResourceModel model, byte[] resource)
The model containing the save operation data
resourcebyte[]The contents of the resource.
Returns:Task<ResourceFileModel>
A task representing the asynchronous save operation with the SharedDataSourceModel containing resource information.
Exceptions:Thrown when the resource name is invalid.
Overrides:
Implements:
Creates the directory path if it doesn't exist and automatically extracts the description from the shared data source definition for metadata purposes.
Validates the provided shared data source definition identifier.
protected override void ValidateDefinitionId(string definitionId)
The definition identifier to validate.
Overrides:
Enforces shared data source naming conventions and URI format requirements for proper resource identification.