Skip to content
Snippets Groups Projects
Commit 4f0d02bc authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

Merge branch '1072111_Doku_EmployeeToken' into '2021.0'

1072111 doku employee token

See merge request xrm/basic!867
parents b4c17990 279a2294
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
= 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.
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment