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
targetRepositoryIRepositoryRepository 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
llListLabelThe ListLabel instance that the repository is assigned to.
parentFolderIdstringThe folder Id of a parent folder, empty string for root.
folderNamestringThe name of the folder to create.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
Returns
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
projectTypeLlProjectProject type, see LlProject.
uiNamestringOptional. Sets a name to display in the UI for this repository item.
folderIdstringOptional. If not empty, this parameter allows to set a folder for the item.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
Returns
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
disposingbool
~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
llListLabelfilePathstringparentIdstringOptional. The ID of a related project item.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
Returns
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
llListLabelThe ListLabel instance that the repository is assigned to.
filePathstringThe local path of the file to import.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
folderIdstringOptional. If not empty, this parameter allows to set a folder for the item.
Returns
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
llListLabelThe ListLabel instance that the repository is assigned to.
filePathstringThe local path of the file to import.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
folderIdstringOptional. If not empty, this parameter allows to set a folder for the item.
Returns
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
llListLabelThe ListLabel instance that the repository is assigned to.
filePathstringThe local path of the file to import.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
folderIdstringOptional. If not empty, this parameter allows to set a folder for the item.
Returns
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
llListLabelThe ListLabel instance that the repository is assigned to.
filePathstringThe local path of the file to import.
parentProjectItemIdstringRepository Item ID of the parent project.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
folderIdstringOptional. If not empty, this parameter allows to set a folder for the item.
Returns
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
llListLabelThe ListLabel instance that the repository is assigned to.
filePathstringThe local path of the file to import.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
printerConfigFilestringOptional. A printer config file assigned to this report project.
sketchImageFilestringOptional. A sketch image file assigned to this report project.
folderIdstringOptional. If not empty, this parameter allows to set a folder for the item.
repositoryItemIdstringOptional. If not null, this parameter allows to set the repository ID to use for the imported project. An existing item is replaced.
recursiveboolOptional. If true, all recursively used project files (drilldown, templates, sub reports,...) will be imported into the repository as well.
Returns
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
llListLabelThe ListLabel instance that the repository is assigned to.
projectFilePathstringThe local path of the project to import.
repositoryItemIdstringOptional. If not null, this parameter allows to set the repository ID to use for the imported project. An existing item is replaced.
folderIdstringOptional. If not empty, this parameter allows to set a folder for the item.
printerConfigFilestringOptional. A printer config file assigned to this report project.
sketchImageFilestringOptional. A sketch image file assigned to this report project.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
Returns
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
llListLabelThe ListLabel instance that the repository is assigned to.
filePathstringThe local path of the file to import.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
folderIdstringOptional. If not empty, this parameter allows to set a folder for the item.
Returns
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
llListLabelThe ListLabel instance that the repository is assigned to.
shpFilePathstringThe local path of the .shp file (Shapefile) to import.
dbfFilePathstringThe local path of the .dbf file (Shapefile database) to import.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
folderIdstringOptional. If not empty, this parameter allows to set a folder for the item.
Returns
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
llListLabelThe ListLabel instance that the repository is assigned to.
filePathstringThe local path of the file to import.
parentProjectItemIdstringRepository Item ID of the parent project.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
folderIdstringOptional. If not empty, this parameter allows to set a folder for the item.
Returns
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
llListLabelThe ListLabel instance that the repository is assigned to.
filePathstringThe local path of the file to import.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
folderIdstringOptional. If not empty, this parameter allows to set a folder for the item.
Returns
SetItemFolderId(string, string, string?)
Sets the parent folderId of a repository item.
public void SetItemFolderId(string itemId, string folderId, string? importData = null)
Parameters
itemIdstringID of the repository item to modify.
folderIdstringThe id of the parent folder.
importDatastringOptional. 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
itemIdstringID of the repository item to modify.
uiNamestringA name to display in the UI instead of the item ID.
lcidintLanguage for which the name is set. Use LCID for the default name.
importDatastringOptional. A custom string which will be passed back in the CreateOrUpdate() call.
TryGetPreviouslyImportedItem(string, out string)
public bool TryGetPreviouslyImportedItem(string originalFilePath, out string assignedRepositoryItemId)