diff --git a/entity/EmployeeToken_entity/EmployeeToken_entity.aod b/entity/EmployeeToken_entity/EmployeeToken_entity.aod index bb7b9740621ddec0a55a5603a430d09a1a83b760..8f90eef25a348dc6043c261fb4611151ace8809e 100644 --- a/entity/EmployeeToken_entity/EmployeeToken_entity.aod +++ b/entity/EmployeeToken_entity/EmployeeToken_entity.aod @@ -3,6 +3,7 @@ <name>EmployeeToken_entity</name> <title>User token</title> <majorModelMode>DISTRIBUTED</majorModelMode> + <documentation>%aditoprj%/entity/EmployeeToken_entity/documentation.adoc</documentation> <titlePlural>User tokens</titlePlural> <recordContainer>db</recordContainer> <entityFields> diff --git a/entity/EmployeeToken_entity/documentation.adoc b/entity/EmployeeToken_entity/documentation.adoc new file mode 100644 index 0000000000000000000000000000000000000000..bae9bc62936159c0e26b0ee19d0878a4d4527bcc --- /dev/null +++ b/entity/EmployeeToken_entity/documentation.adoc @@ -0,0 +1,12 @@ += User Token + +.Definition +This entity manages authentication tokens for users. +Those tokens might be the token for the automatic login or other special tokens used for authentication. + +.Purpose +Users or the admin can see which tokens are in the system for a particular user. +Tokens might be removed manually for various reasons. + +.Other +This entity belongs to the Employee_entity. diff --git a/process/blobHandler/process.js b/process/blobHandler/process.js index 210e350aff3c2cd0a5b0ce4e8a95b31f54b76171..6092c676875883a3f54019b98a27bca2c61f86da 100644 --- a/process/blobHandler/process.js +++ b/process/blobHandler/process.js @@ -5,6 +5,12 @@ import("system.util"); import("system.fileIO"); import("system.vars"); +/* + * This process is used in order to process binary data. + * It contains functions to create, delete, update and read binary data from the file system. + * This process uses the id of the dataset as filename. + */ + var path = vars.get("$sys.serverdata") + "/binaryfiles/" var operation = null; @@ -31,21 +37,47 @@ if (operation) operation(path, vars.get("$local.idvalue")); } +/* + * Create a file at the given path with the given pathname. + * + * @param path the path where the file is to be created + * @param filename the name under which the file is created, this can for example be a UID + */ function createBlob (path, filename) { _writeBlob(path + filename ) } +/* + * Delete a file at the given path with the given pathname. + * + * @param path the path where the file is located + * @param filename the name of the file to delete + */ function deleteBlob (path, filename) { fileIO.remove(path + filename ); } +/* + * Update a file at the given path with the given pathname. + * + * @param path the path where the file is to be updated/overwritten + * @param filename the name of the file that is to be overwritten + */ function updateBlob (path, filename) { _writeBlob(path + filename ); } +/* + * Read a file from the given path with the given pathname. + * If the file is not found in the specified location, the function tries to read it from the database (table ASYS_BINARIES). + * This is useful if at one point the storage method for files is changed from DATABASE to SCRIPT. + * + * @param path the path where the file is located + * @param filename the name of the file + */ function readBlob (path, filename) { var fullPath = path + filename; @@ -66,6 +98,12 @@ function readBlob (path, filename) } } +/* + * Stores a file at the given path. + * The path has to include the filename. + * + * @param fullPath the path where the file is stored concatenated with the filename, e.g. '/files/adito/c6fcb4ad-7280-4f3c-ad98-2a749510c21a' + */ function _writeBlob (fullPath) { fileIO.storeData(fullPath, vars.get("$local.data"), util.DATA_BINARY, false);