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