Table of Contents

Class RepositoryImportUtil

Namespace
combit.Reporting.Repository
Assembly
combit.ListLabel31.CrossPlatform.dll

Helper class for repositories to support the import of local files. See IRepository for more information on repositories. Note that this class should always be disposed after use!

public class RepositoryImportUtil : IDisposable
Inheritance
RepositoryImportUtil
Implements
Inherited Members

Constructors

RepositoryImportUtil(IRepository)

Creates a new instance of the RepositoryImportUtil for the specified repository.

public RepositoryImportUtil(IRepository targetRepository)

Parameters

targetRepository IRepository

Repository instance that the methods of this util will work with.

Methods

CreateFolder(ListLabel, string, string, string?)

Creates a folder in the repository and returns the ID of the created repository item. Once the item is ready and the metadata objects are prepared, internally the repository's CreateOrUpdateItem() method is called to store it in the repository.

public string CreateFolder(ListLabel ll, string parentFolderId, string folderName, string? importData = null)

Parameters

ll ListLabel

The ListLabel instance that the repository is assigned to.

parentFolderId string

The folder Id of a parent folder, empty string for root.

folderName string

The name of the folder to create.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

Returns

string

CreateNewProject(LlProject, string?, string?, string?)

Adds an empty project of the specified type to the repository and returns the ID of the created repository item. Once the file is ready and the metadata objects are prepared, internally the repository's CreateOrUpdateItem() method is called to store it in the repository.

public string CreateNewProject(LlProject projectType, string? uiName = null, string? folderId = "", string? importData = null)

Parameters

projectType LlProject

Project type, see LlProject.

uiName string

Optional. Sets a name to display in the UI for this repository item.

folderId string

Optional. If not empty, this parameter allows to set a folder for the item.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

Returns

string

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

~RepositoryImportUtil()

protected ~RepositoryImportUtil()

ImportFileByExtension(ListLabel, string, string, string?)

Imports a file to the repository depending on its extension

public string ImportFileByExtension(ListLabel ll, string filePath, string parentId = "", string? importData = null)

Parameters

ll ListLabel
filePath string
parentId string

Optional. The ID of a related project item.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

Returns

string

ImportImageFile(ListLabel, string, string?, string)

Imports an image (.jpg /.png/.gif/...) file to the repository and returns the ID of the created repository item. Once the file is ready and the metadata objects are prepared, internally the repository's CreateOrUpdateItem() method is called to store it in the repository.

public string ImportImageFile(ListLabel ll, string filePath, string? importData = null, string folderId = "")

Parameters

ll ListLabel

The ListLabel instance that the repository is assigned to.

filePath string

The local path of the file to import.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

folderId string

Optional. If not empty, this parameter allows to set a folder for the item.

Returns

string

ImportIndexFile(ListLabel, string, string?, string)

Imports an index project (.idx) file to the repository and returns the ID of the created repository item. Once the file is ready and the metadata objects are prepared, internally the repository's CreateOrUpdateItem() method is called to store it in the repository.

public string ImportIndexFile(ListLabel ll, string filePath, string? importData = null, string folderId = "")

Parameters

ll ListLabel

The ListLabel instance that the repository is assigned to.

filePath string

The local path of the file to import.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

folderId string

Optional. If not empty, this parameter allows to set a folder for the item.

Returns

string

ImportPdfFile(ListLabel, string, string?, string)

Imports a PDF file to the repository and returns the ID of the created repository item. Once the file is ready and the metadata objects are prepared, internally the repository's CreateOrUpdateItem() method is called to store it in the repository.

public string ImportPdfFile(ListLabel ll, string filePath, string? importData = null, string folderId = "")

Parameters

ll ListLabel

The ListLabel instance that the repository is assigned to.

filePath string

The local path of the file to import.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

folderId string

Optional. If not empty, this parameter allows to set a folder for the item.

Returns

string

ImportPrinterConfigFile(ListLabel, string, string, string?, string)

Imports a printer config (.lsp) file to the repository and returns the ID of the created repository item. Note that a printer config file is specific to a report project, so the parent project's item ID must be specified. Once the file is ready and the metadata objects are prepared, internally the repository's CreateOrUpdateItem() method is called to store it in the repository.

public string ImportPrinterConfigFile(ListLabel ll, string filePath, string parentProjectItemId, string? importData = null, string folderId = "")

Parameters

ll ListLabel

The ListLabel instance that the repository is assigned to.

filePath string

The local path of the file to import.

parentProjectItemId string

Repository Item ID of the parent project.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

folderId string

Optional. If not empty, this parameter allows to set a folder for the item.

Returns

string

ImportProjectFile(ListLabel, string, string?, string?, string?, string?, string?, bool)

Imports a project file (usually a .lst/.crd/.lbl file) to the repository and returns the ID of the created repository item. Use this method for a fast import of a single-file project to the repository. This method does NOT import any dependencies like images, drilldown projects, project templates etc. to the repository! If the project might use other files, better use ImportProjectFileWithDependencies(ListLabel, string, string?, string?, string?, string?, string?).

public string ImportProjectFile(ListLabel ll, string filePath, string? importData = null, string? printerConfigFile = null, string? sketchImageFile = null, string? folderId = "", string? repositoryItemId = null, bool recursive = false)

Parameters

ll ListLabel

The ListLabel instance that the repository is assigned to.

filePath string

The local path of the file to import.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

printerConfigFile string

Optional. A printer config file assigned to this report project.

sketchImageFile string

Optional. A sketch image file assigned to this report project.

folderId string

Optional. If not empty, this parameter allows to set a folder for the item.

repositoryItemId string

Optional. If not null, this parameter allows to set the repository ID to use for the imported project. An existing item is replaced.

recursive bool

Optional. If true, all recursively used project files (drilldown, templates, sub reports,...) will be imported into the repository as well.

Returns

string

ImportProjectFileWithDependencies(ListLabel, string, string?, string?, string?, string?, string?)

Imports a project file into the repository like ImportProjectFile(ListLabel, string, string?, string?, string?, string?, string?, bool) and returns the ID of the created repository item. Other than ImportProjectFile(), this method will load the project via DOM and exchange all references to local files (e.g. images) with repository items for those files. Furthermore this method recursively loads all referenced project files (e.g. for drilldown, includes, table of contents, ...) in the same way and also imports their dependencies into the repository. This method call may be expensive, however the imported project should be ready to use from just the repository without needing any local files anymore. When importing multiple files, always use the same instance of the RepositoryImportUtil so already imported files are reused.

public string ImportProjectFileWithDependencies(ListLabel ll, string projectFilePath, string? repositoryItemId = null, string? folderId = "", string? printerConfigFile = null, string? sketchImageFile = null, string? importData = null)

Parameters

ll ListLabel

The ListLabel instance that the repository is assigned to.

projectFilePath string

The local path of the project to import.

repositoryItemId string

Optional. If not null, this parameter allows to set the repository ID to use for the imported project. An existing item is replaced.

folderId string

Optional. If not empty, this parameter allows to set a folder for the item.

printerConfigFile string

Optional. A printer config file assigned to this report project.

sketchImageFile string

Optional. A sketch image file assigned to this report project.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

Returns

string

ImportReverseSideFile(ListLabel, string, string?, string)

Imports a reverse-side project (.gtx) file to the repository and returns the ID of the created repository item. Once the file is ready and the metadata objects are prepared, internally the repository's CreateOrUpdateItem() method is called to store it in the repository.

public string ImportReverseSideFile(ListLabel ll, string filePath, string? importData = null, string folderId = "")

Parameters

ll ListLabel

The ListLabel instance that the repository is assigned to.

filePath string

The local path of the file to import.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

folderId string

Optional. If not empty, this parameter allows to set a folder for the item.

Returns

string

ImportShapefile(ListLabel, string, string, string?, string?)

Imports a shapefile (.shp/.dbf files) to the repository and returns the IDs of the created repository items (Item1: .shp File, Item2: .dbf File). Once the file is ready and the metadata objects are prepared, internally the repository's CreateOrUpdateItem() method is called to store it in the repository.

public Tuple<string, string> ImportShapefile(ListLabel ll, string shpFilePath, string dbfFilePath, string? importData = null, string? folderId = "")

Parameters

ll ListLabel

The ListLabel instance that the repository is assigned to.

shpFilePath string

The local path of the .shp file (Shapefile) to import.

dbfFilePath string

The local path of the .dbf file (Shapefile database) to import.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

folderId string

Optional. If not empty, this parameter allows to set a folder for the item.

Returns

Tuple<string, string>

ImportSketchImageFile(ListLabel, string, string, string?, string)

Imports a sketch image file to the repository and returns the ID of the created repository item. Note that a sketch image file is specific to a report project, so the parent project's item ID must be specified. Once the file is ready and the metadata objects are prepared, internally the repository's CreateOrUpdateItem() method is called to store it in the repository.

public string ImportSketchImageFile(ListLabel ll, string filePath, string parentProjectItemId, string? importData = null, string folderId = "")

Parameters

ll ListLabel

The ListLabel instance that the repository is assigned to.

filePath string

The local path of the file to import.

parentProjectItemId string

Repository Item ID of the parent project.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

folderId string

Optional. If not empty, this parameter allows to set a folder for the item.

Returns

string

ImportTableOfContentsFile(ListLabel, string, string?, string)

Imports a table-of-contents project (.toc) file to the repository and returns the ID of the created repository item. Once the file is ready and the metadata objects are prepared, internally the repository's CreateOrUpdateItem() method is called to store it in the repository.

public string ImportTableOfContentsFile(ListLabel ll, string filePath, string? importData = null, string folderId = "")

Parameters

ll ListLabel

The ListLabel instance that the repository is assigned to.

filePath string

The local path of the file to import.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

folderId string

Optional. If not empty, this parameter allows to set a folder for the item.

Returns

string

SetItemFolderId(string, string, string?)

Sets the parent folderId of a repository item.

public void SetItemFolderId(string itemId, string folderId, string? importData = null)

Parameters

itemId string

ID of the repository item to modify.

folderId string

The id of the parent folder.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

SetItemUIName(string, string, int, string?)

Sets the (optional) name to display in the UI for a repository item for the specified language. A repository item may have a dinstinct UI name for each language. Note that repository items are only identified by the item ID, so multiple items can have the same UI name. Requires Syncing after setting a new name.

public void SetItemUIName(string itemId, string uiName, int lcid = 0, string? importData = null)

Parameters

itemId string

ID of the repository item to modify.

uiName string

A name to display in the UI instead of the item ID.

lcid int

Language for which the name is set. Use LCID for the default name.

importData string

Optional. A custom string which will be passed back in the CreateOrUpdate() call.

TryGetPreviouslyImportedItem(string, out string)

public bool TryGetPreviouslyImportedItem(string originalFilePath, out string assignedRepositoryItemId)

Parameters

originalFilePath string
assignedRepositoryItemId string

Returns

bool