File Exchange
Introduction
The File Exchange container allows Trust1Connector to upload or download files from the filesystem to the requesting party. In order to be able to access the file system, a separate file_exchange
consent is required, only when the consent has been configured to true upon installation of the T1C-GCL.
The File Exchange container provides the following functionalities:
selecting a folder based on application type
listing files in selected application type
downloading one or more files into selected application type
uploading one or more files from the selected application type
An application type resolves locally to an absolute file system path.
An application can create additional folders for a given application type, those folders are relative to the absolute path which has been locally mapped on the application type.
The File Exchange container provides additionally:
optional progress bar for file transfers
optional user notification for file transfer completion
user notification when browser is closed during file transfer
implicit user consent based on pre-defined algorithm using the operating system clipboard
copy and move files between application types
Notifications
The File Exchange container allows the application to choose whether to notify the users in the application context, or to delegate notification to the T1C. The T1C uses the underlying operating system to notify users. Two types of notifications are provided:
Modal information
Progress bar information
Context and scope
The context of a type mapping is defined by the following concepts:
applid (property of Type class): a string value denoting the application identifier. This is the root context for entity mapping
entity: a string value denoting the root entity for types mapping
type: a string value denoting a file typing, related to the absolute path mapped by an user, this value abstracts absolute paths from an application perspective
The following image depicts the file exchange object model:
Type Mapping
A 'Type' in the context of the File Exchange container, is a label, used by an application, to abstract the absolute path reference of the local file system. A 'Type' allows the application to perform file transfers, without the notion of the local file system organization. The File Exchange container maps the absolute path, chose by a user, on the application scoped label. We call this action a 'type mapping', this is, an absolute path, in the context of an application, is references by a label.
A user can chose to 'persist' the Type mapping, or can decide to assign an absolute path for each individual transaction.
Bulk File Transfer
The File Exchange container allows for bulk file transfer. The individual methods are stateless requests to the T1C-GCL service, and allows to up- or download one or more files from a user perspective. The progress information can be retrieved by the application for each file separately or for all the actions running on the T1C-GCL service.
Type subfolders
Subfolders can be managed by the application. All subfolder are relative paths and when requested can be created, optionally recursively, by the File Exchange API. It's important to understand:
Type mapping : correlates to absolute paths on a local file system
Type subfolders: correlates to relative paths on a local file system
The File Exchange container maintains the mapping for absolute paths. Relative paths will be created when used in the specified use case. Neither absolute paths or relative paths will result in deletion on the local file system! When deleting a 'type' (aka absolute path), the type will be removed from the File Exchange container, but the references directory will still exist on the user's file system.
In the File Exchange API, the parameter relpath
refers to an array of strings denoting a directory path.
Responses
The File Exchange API can be integrated using Promises or callbacks. Both are returning the same result.
Language
The language, used for OS modals, is determined by the language parameter passed on initialization of the library, as one of the GCLConfig parameters. The languages parameter can take the value: en (English), nl (Dutch), fr (French), de (German) and defaults to en (English).
Interface
Objects
Enums
The following enumerators have been exported by the File Exchange container:
Enum | Values | Description |
FileSort | ASC, DESC | Used for sorting files. ASC = ascending, DESC = descending |
AccessMode | READ, WRITE, EXECUTE | Used to inform about the access permissions on the local file system. READ = read access to file or folder, WRITE = write access to file or folder, EXECUTE = execute access to file or folder |
TypeStatus | MAPPED, UNMAPPED | Use to inform the application if a Type has been mapped to an absolute path by the user. |
FileAction | UPLOAD, DOWNLOAD, COPY, MOVE | Enum used to track the progress of a file during a file action. UPLOAD = file upload from the local file system to the application, DOWNLOAD = file download from the application to the local file system, COPY = copy on local filesystem, MOVE = move on local filesystem |
ModalType | INFO, CHOICE | Enum used to show an operating system modal. INFO = for information purpose, CHOICE = yes/no for user choice |