Joget DX 8 Stable Released
The stable release for Joget DX 8 is now available, with a focus on UX and Governance.
import java.io.File; import java.io.IOException; import org.joget.apps.form.service.FileUtil; String recordId = "ID-0001"; String tableName = "crm_contact"; String fileName = "profile_image.png"; //Get the uploaded file of a form data record try { File profileImage = FileUtil.getFile(fileName, tableName, recordId); }catch (IOException e) {}
public static void checkAndUpdateFileName(org.joget.apps.form.model.FormRowSet results, org.joget.apps.form.model.Element form, java.lang.String primaryKeyValue)
Method used to check for the duplicate file name of files in the FormRowSet object against the existing files in the target upload directory.
It will update the file name by appending with number if found duplicated.
public static void checkAndUpdateFileName(org.joget.apps.form.model.FormRowSet results, java.lang.String tableName, java.lang.String primaryKeyValue)
Method used to check for the duplicate file name of files in the FormRowSet object against the existing files in the target upload directory.
It will update the file name by appending with number if found duplicated.
public static org.springframework.context.ApplicationContext getApplicationContext()
Utility method to retrieve the ApplicationContext of the system
public static java.io.File getFile(java.lang.String fileName, org.joget.apps.form.model.Element form, java.lang.String primaryKeyValue) throws java.io.IOException
Gets the file from target upload directory of a form data record
public static java.io.File getFile(java.lang.String fileName, java.lang.String tableName, java.lang.String primaryKeyValue) throws java.io.IOException
Gets the file from target upload directory of a form data record
public static java.lang.String getTableName (org.joget.apps.form.model.Element form)
Method used to gets the table name from the properties of a Form object
public static java.lang.String getUploadPath(org.joget.apps.form.model.Element form, java.lang.String primaryKeyValue)
Gets the target upload directory of a form data record
public static java.lang.String getUploadPath(java.lang.String tableName, java.lang.String primaryKeyValue)
Gets the target upload directory of a form data record
public static void storeFile(java.io.File file, java.lang.String tableName, java.lang.String primaryKeyValue)
Store file to target upload directory of a form data record
public static void storeFile(org.springframework.web.multipart.MultipartFile file, org.joget.apps.form.model.Element form, java.lang.String primaryKeyValue)
Store file to target upload directory of a form data record
public static void storeFileFromFormRowSet(org.joget.apps.form.model.FormRowSet results, org.joget.apps.form.model.Element form, java.lang.String primaryKeyValue)
Store files in the FormRowSet to target upload directory of a form data record
public static void storeFileFromFormRowSet(org.joget.apps.form.model.FormRowSet results, java.lang.String tableName, java.lang.String primaryKeyValue)
Store files in the FormRowSet to target upload directory of a form data record
public static java.lang.String validateFileName(java.lang.String fileName, java.lang.String path, java.util.Set<java.lang.String> existedFileName)
Validate the file name against the existing files in the target upload directory.
Parameters:
existedFileName - a set of file names which not yet exist in the target upload directory but the current checking file should not has the same file name in it.
Return the new file name with number appended when duplicate file is found.