Class
FileSharedDataSourceStorage

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:

cs-api-definition
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

FileSharedDataSourceStorage(string)

Initializes a new instance of the FileSharedDataSourceStorage class.

Declaration

cs-api-definition
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

cs-api-definition
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

cs-api-definition
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

cs-api-definition
protected override string[] FileExtensions { get; }

Property Value

string[]

Overrides FileDefinitionStorageBase.FileExtensions

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

cs-api-definition
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 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.

IsExtensionValid(string)

Determines if the provided resource extension is valid for shared data sources.

Declaration

cs-api-definition
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 ResourceStorageBase.IsExtensionValid(string)

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

cs-api-definition
public override ResourceFileModel Move(MoveResourceModel model)

Parameters

model

MoveResourceModel

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.

Overwrite(OverwriteResourceModel, byte[])

Overwrites an existing shared data source definition file with new content.

Declaration

cs-api-definition
public override ResourceFileModel Overwrite(OverwriteResourceModel model, byte[] resource)

Parameters

model

OverwriteResourceModel

The model containing overwrite operation data.

resource

byte[]

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.

RenameAsync(RenameResourceModel)

Renames a shared data source definition file.

Declaration

cs-api-definition
public override Task<ResourceFileModel> RenameAsync(RenameResourceModel model)

Parameters

model

RenameResourceModel

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.

SaveAsync(SaveResourceModel, byte[])

Saves shared data source content and returns the resource information with extracted description.

Declaration

cs-api-definition
public override Task<ResourceFileModel> SaveAsync(SaveResourceModel model, byte[] resource)

Parameters

model

SaveResourceModel

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

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.

ValidateDefinitionId(string)

Validates the provided shared data source definition identifier.

Declaration

cs-api-definition
protected override void ValidateDefinitionId(string definitionId)

Parameters

definitionId

string

The definition identifier to validate.

Overrides FileDefinitionStorageBase.ValidateDefinitionId(string)

Remarks

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