* If the form file can't be read, then the form is deleted from the DB and an exception is thrown.
* If the form exists only in the DB and was never exported, then it is exported.
*
* - Form file location: SYSTEM_FORM_FILE_PATH
* - Recognize form file change: Compare the current file stats with the ones saved in the Form table.
* - Container References: The form file uses names instead if ids to reference container formElements. These references are translated when the formElements are inserted.
* - Ignored keys: The keys 'id', 'formId', 'feIdContainer' are ignored when reading the form file.
...
...
@@ -85,46 +84,71 @@ class FormAsFile {
self::deleteFormDB($formName,$database,"Failed to read form file.");
* Remove the form from the DB and insert it using the given form json.
*
* - Container References: The form json uses names instead if ids to reference container formElements. These references are translated when the formElements are inserted.
* - Ignored keys: The keys 'id', 'formId', 'feIdContainer' are ignored when reading the form json.
Thrower::userFormException('Failed to import form file.',
"Key '".FE_FILE_CONTAINER_NAME."' points to non-existing container with name '$containerName' in definition of formElement with name '".$formElementFromFile[FE_NAME]."' in file '$absoluteFormFilePath'");
Thrower::userFormException('Failed to import form json.',
"Key '".FE_FILE_CONTAINER_NAME."' points to non-existing container with name '$containerName' in definition of formElement with name '".$formElementFromJson[FE_NAME]
.($absoluteFormFilePath!==null?". Form file path: '$absoluteFormFilePath'":''));
Thrower::userFormException('Rendering Json Form failed.',"The special column '_".COLUMN_FORM_JSON."' Expects an integer form id but '$columnValue' given.");