New to Telerik ReportingStart a free 30-day trial

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:

C#
public class FileSharedDataSourceStorage : FileDefinitionStorageBase, ISharedDataSourceStorage, IResourceStorage, IAssetsStorage

Inheritance: objectResourceStorageBaseResourceStorageFileDefinitionStorageBaseFileSharedDataSourceStorage

Implements: IAssetsStorageIResourceStorageISharedDataSourceStorage

Inherited Members FileDefinitionStorageBase.GetFolderContents(string, string[])FileDefinitionStorageBase.GetByUri<TDefinitionNotFoundException>(string)FileDefinitionStorageBase.RenameAsync<TInvalidDefinitionNameException>(RenameResourceModel)FileDefinitionStorageBase.SaveAsync<TDefinitionNotFoundException>(SaveResourceModel, byte[])FileDefinitionStorageBase.GetFolderAsync(string)FileDefinitionStorageBase.DeleteAsync(string)FileDefinitionStorageBase.Save(SaveResourceModel, byte[], bool, bool)FileDefinitionStorageBase.WrapException<TResult, TDefinitionException, TResourceException>(Func<TResult>)ResourceStorage.RootFolderNameResourceStorage.GetOrderedDefaultFoldersToCreate()ResourceStorage.GetAllByExtension(string[])ResourceStorage.GetFolderContentsAsync(string)ResourceStorage.FolderHasContents(string)ResourceStorage.GetFolderByName(string)ResourceStorage.CreateFolderAsync(CreateFolderModel)ResourceStorage.MoveFolder(MoveFolderModel)ResourceStorage.RenameFolderAsync(RenameFolderModel)ResourceStorage.DeleteFolderAsync(string)ResourceStorage.FolderNameExists(string)ResourceStorage.FolderExists(string)ResourceStorage.GetAsync(string)ResourceStorage.GetByUri(string)ResourceStorage.ResourceNameExists(string)ResourceStorage.ResourceExists(string)ResourceStorage.GetFile(string)ResourceStorage.GetModelByName(string)ResourceStorage.GetModelCore<T>(string)ResourceStorage.Save(string, byte[])ResourceStorage.SaveAsync(SaveResourceModel, byte[], bool)ResourceStorage.SaveCore<T>(SaveResourceModel, byte[], bool)ResourceStorage.OverwriteCore<T>(OverwriteResourceModel, byte[])ResourceStorage.RenameCore<T>(RenameResourceModel)ResourceStorage.MoveCore<T>(MoveResourceModel)ResourceStorage.Search(SearchResourcesModel)ResourceStorage.CreateDirectory(string[])ResourceStorage.EnsureDefaultFolders()ResourceStorage.CreateDefaultFolder(CreateFolderModel)ResourceStorage.BaseDirResourceStorageBase.defaultFoldersResourceStorageBase.DefaultFoldersToCreateResourceStorageBase.ValidateSavedResourceExtension(string)...

Constructors

Initializes a new instance of the FileSharedDataSourceStorage class with folder exclusions.

C#
public FileSharedDataSourceStorage(string baseDir, string[] definitionFolders, string[] excludedFolders)
Parameters:baseDirstring

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.

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.

Initializes a new instance of the FileSharedDataSourceStorage class with specific definition folders.

C#
public FileSharedDataSourceStorage(string baseDir, string[] definitionFolders)
Parameters:baseDirstring

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.

Remarks:

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.

C#
public FileSharedDataSourceStorage(string baseDir)
Parameters:baseDirstring

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.

Properties

Gets the array of allowed shared data source file extensions.

C#
protected override string[] FileExtensions { get; }

Overrides: FileDefinitionStorageBase.FileExtensions

Remarks:

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.

C#
public override Task<ResourceFileModel> GetModelAsync(string uri)
Parameters:uristring

The unique resource identifier (URI)

Returns:

Task<ResourceFileModel>

A task representing the asynchronous operation with the SharedDataSourceModel containing resource information.

Overrides: FileDefinitionStorageBase.GetModelAsync(string)

Implements: IAssetsStorage.GetModelAsync(string)

Remarks:

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.

C#
protected override bool IsExtensionValid(string resourceExtension)
Parameters:resourceExtensionstring

The file extension to validate.

Returns:

bool

True if the extension is valid for shared data sources, false otherwise.

Overrides: ResourceStorageBase.IsExtensionValid(string)

Remarks:

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.

C#
public override ResourceFileModel Move(MoveResourceModel model)
Parameters:modelMoveResourceModel

The model containing the move operation data

Returns:

ResourceFileModel

The SharedDataSourceModel containing information about the moved resource.

Overrides: ResourceStorage.Move(MoveResourceModel)

Implements: IResourceStorage.Move(MoveResourceModel)

Remarks:

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.

C#
public override ResourceFileModel Overwrite(OverwriteResourceModel model, byte[] resource)
Parameters:modelOverwriteResourceModel

The model containing overwrite operation data.

resourcebyte[]

The new shared data source definition content as a byte array.

Returns:

ResourceFileModel

The SharedDataSourceModel containing information about the overwritten resource.

Overrides: ResourceStorage.Overwrite(OverwriteResourceModel, byte[])

Implements: IResourceStorage.Overwrite(OverwriteResourceModel, byte[])

Remarks:

Validates the resource URI and automatically extracts the description from the new shared data source content.

Renames a shared data source definition file.

C#
public override Task<ResourceFileModel> RenameAsync(RenameResourceModel model)
Parameters:modelRenameResourceModel

The model containing rename operation data.

Returns:

Task<ResourceFileModel>

A task representing the asynchronous rename operation with the updated resource model.

Overrides: ResourceStorage.RenameAsync(RenameResourceModel)

Implements: IAssetsStorage.RenameAsync(RenameResourceModel)

Remarks:

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.

C#
public override Task<ResourceFileModel> SaveAsync(SaveResourceModel model, byte[] resource)
Parameters:modelSaveResourceModel

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:

InvalidResourceNameException

Thrown when the resource name is invalid.

Overrides: ResourceStorage.SaveAsync(SaveResourceModel, byte[])

Implements: IAssetsStorage.SaveAsync(SaveResourceModel, byte[])

Remarks:

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.

C#
protected override void ValidateDefinitionId(string definitionId)
Parameters:definitionIdstring

The definition identifier to validate.

Overrides: FileDefinitionStorageBase.ValidateDefinitionId(string)

Remarks:

Enforces shared data source naming conventions and URI format requirements for proper resource identification.