Package org.joget.apps.form.model

Examples of org.joget.apps.form.model.FormRow


                            primaryKey = wfAssignment.getProcessId();
                        }
                    }

                    String cacheKey = tableName + "##" + primaryKey;
                    FormRow row = formDataCache.get(cacheKey);
                    if (row == null) {       
                        row = formDataDao.loadByTableNameAndColumnName(tableName, columnName, primaryKey);
                        formDataCache.put(cacheKey, row);
                    }

                    if (row != null && row.getCustomProperties() != null) {
                        Object val = row.getCustomProperties().get(columnName);
                        if (val != null) {
                            return val.toString();
                        } else {
                            LogUtil.debug(FormHashVariable.class.getName(), "#form." + variableKey + "# is NULL");
                            return "";
View Full Code Here


                    }
                } catch (Exception e) {}
            }
            if (value != null) {
                // set value into Properties and FormRowSet object
                FormRow result = new FormRow();
                result.setProperty(id, value);
                rowSet = new FormRowSet();
                rowSet.add(result);
            }
        }
View Full Code Here

        String id = getPropertyString(FormUtil.PROPERTY_ID);
        if (id != null) {
            String value = FormUtil.getElementPropertyValue(this, formData);
            if (value != null) {
                // set value into Properties and FormRowSet object
                FormRow result = new FormRow();
               
                // check if the file is in temp file
                File file = FileManager.getFileByPath(value);
                if (file != null) {
                    result.putTempFilePath(id, value);
                    result.setProperty(id, file.getName());
                   
                    String paramName = FormUtil.getElementParameterName(this);
                    formData.addRequestParameterValues(paramName, new String[]{file.getName()});
                } else {
                    result.setProperty(id, value);
                }
               
                rowSet = new FormRowSet();
                rowSet.add(result);
            }
View Full Code Here

                // formulate values
                String delimitedValue = FormUtil.generateElementPropertyValues(values);

                // set value into Properties and FormRowSet object
                FormRow result = new FormRow();
                result.setProperty(id, delimitedValue);
                rowSet = new FormRowSet();
                rowSet.add(result);
            }
        }
View Full Code Here

                } else {
                    value = SecurityUtil.encrypt(value);
                }
               
                // set value into Properties and FormRowSet object
                FormRow result = new FormRow();
                result.setProperty(id, value);
                rowSet = new FormRowSet();
                rowSet.add(result);
            }
        }
View Full Code Here

                String paramName = FormUtil.getElementParameterName(this);
                formData.addRequestParameterValues(paramName, new String[] {value});
            }
            if (value != null) {
                // set value into Properties and FormRowSet object
                FormRow result = new FormRow();
                result.setProperty(id, value);
                rowSet = new FormRowSet();
                rowSet.add(result);
            }
        }
View Full Code Here

                // formulate values
                String delimitedValue = FormUtil.generateElementPropertyValues(values);

                // set value into Properties and FormRowSet object
                FormRow result = new FormRow();
                result.setProperty(id, delimitedValue);
                rowSet = new FormRowSet();
                rowSet.add(result);
            }
        }
View Full Code Here

                FormDataDao formDataDao = (FormDataDao) AppUtil.getApplicationContext().getBean("formDataDao");
                results = formDataDao.find(formDefId, tableName, condition, conditionParams, labelColumn, false, null, null);

                if (results != null) {
                    if ("true".equals(getPropertyString("addEmptyOption"))) {
                        FormRow emptyRow = new FormRow();
                        emptyRow.setProperty(FormUtil.PROPERTY_VALUE, "");
                        emptyRow.setProperty(FormUtil.PROPERTY_LABEL, getPropertyString("emptyLabel"));
                        filtered.add(emptyRow);
                    }

                    //Determine id column. Setting to default if not specified
                    String idColumn = (String) getProperty("idColumn");
View Full Code Here

   
    public static void checkAndUpdateFileName(FormRowSet results, Element element, String primaryKeyValue) {
        Set<String> existedFileName = new HashSet<String>();
       
        for (int i = 0; i < results.size(); i++) {
            FormRow row = results.get(i);
            String id = row.getId();
            if (id != null && !id.isEmpty()) {
                Map<String, String> tempFilePathMap = row.getTempFilePathMap();
                if (tempFilePathMap != null && !tempFilePathMap.isEmpty()) {
                    for (Iterator<String> j = tempFilePathMap.keySet().iterator(); j.hasNext();) {
                        String fieldId = j.next();
                        String path = tempFilePathMap.get(fieldId);
                        if (!path.endsWith(FileManager.THUMBNAIL_EXT)) {
                            File file = FileManager.getFileByPath(path);
                            if (file != null) {
                                String fileName = file.getName();
                                String uploadPath = getUploadPath(element, id);

                                String newFileName = validateFileName(fileName, uploadPath, existedFileName);
                                existedFileName.add(newFileName);

                                if (row.containsKey(fieldId)) {
                                    row.put(fieldId, newFileName);
                                }

                                if (!newFileName.equals(file.getName())) {
                                    String newPath = path.replace(file.getName(), newFileName);
View Full Code Here

        return fileName;
    }

    public static void storeFileFromFormRowSet(FormRowSet results, Element element, String primaryKeyValue) {
        for (int i = 0; i < results.size(); i++) {
            FormRow row = results.get(i);
            String id = row.getId();
            Map<String, String> tempFilePathMap = row.getTempFilePathMap();
            if (tempFilePathMap != null && !tempFilePathMap.isEmpty()) {
                for (Iterator<String> j = tempFilePathMap.keySet().iterator(); j.hasNext();) {
                    String fieldId = j.next();
                    String path = tempFilePathMap.get(fieldId);
                    File file = FileManager.getFileByPath(path);
View Full Code Here

TOP

Related Classes of org.joget.apps.form.model.FormRow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.