Package org.joget.apps.app.model

Examples of org.joget.apps.app.model.FormDefinition


            model.addAttribute("appVersion", appVersion);
            AppDefinition appDef = appService.getAppDefinition(appId, appVersion);

            String tempJson = json;
            if (tempJson.contains(SecurityUtil.ENVELOPE) || tempJson.contains(PropertyUtil.PASSWORD_PROTECTED_VALUE)) {
                FormDefinition formDef = formDefinitionDao.loadById(formId, appDef);

                if (formDef != null) {
                    tempJson = PropertyUtil.propertiesJsonStoreProcessing(formDef.getJson(), tempJson);
                }
            }

            String elementHtml = formService.previewElement(tempJson, false);
            model.addAttribute("elementTemplate", elementHtml);
View Full Code Here


            model.addAttribute("appVersion", appVersion);
            AppDefinition appDef = appService.getAppDefinition(appId, appVersion);

            String tempJson = json;
            if (tempJson.contains(SecurityUtil.ENVELOPE) || tempJson.contains(PropertyUtil.PASSWORD_PROTECTED_VALUE)) {
                FormDefinition formDef = formDefinitionDao.loadById(formId, appDef);

                if (formDef != null) {
                    tempJson = PropertyUtil.propertiesJsonStoreProcessing(formDef.getJson(), tempJson);
                }
            }

            String elementHtml = formService.previewElement(tempJson);
            model.addAttribute("elementTemplate", elementHtml);
View Full Code Here

    @RequestMapping("/client/app/(*:appId)/(~:version)/form/download/(*:formDefId)/(*:primaryKeyValue)/(*:fileName)")
    public void downloadUploadedFile(HttpServletResponse response, @RequestParam("formDefId") String formDefId, @RequestParam(value = "appId") String appId, @RequestParam(value = "version", required = false) String version, @RequestParam("primaryKeyValue") String primaryKeyValue, @RequestParam("fileName") String fileName, @RequestParam(required = false) String attachment) throws IOException {
        ServletOutputStream stream = response.getOutputStream();
        Form form = null;
        AppDefinition appDef = appService.getAppDefinition(appId, version);
        FormDefinition formDef = formDefinitionDao.loadById(formDefId, appDef);
        if (formDef != null) {
            String json = formDef.getJson();
            form = (Form) formService.createElementFromJson(json);
        }
        String decodedFileName = fileName;
        try {
            decodedFileName = URLDecoder.decode(fileName, "UTF8");
View Full Code Here

        Map<String, FormDefinition> formMap = new HashMap<String, FormDefinition>();
        for (String activityDefId : activityFormMap.keySet()) {
            PackageActivityForm paf = activityFormMap.get(activityDefId);
            String formId = paf.getFormId();
            if (PackageActivityForm.ACTIVITY_FORM_TYPE_SINGLE.equals(paf.getType()) && formId != null && !formId.isEmpty()) {
                FormDefinition formDef = formDefinitionDao.loadById(formId, appDef);
                formMap.put(activityDefId, formDef);
            }
        }

        //get variable list
View Full Code Here

    public String consoleFormCreate(ModelMap model, @RequestParam(value = "appId") String appId, @RequestParam(value = "version", required = false) String version, @RequestParam(value = "activityDefId", required = false) String activityDefId, @RequestParam(value = "processDefId", required = false) String processDefId) {
        AppDefinition appDef = appService.getAppDefinition(appId, version);
        model.addAttribute("appId", appId);
        model.addAttribute("appVersion", version);
        model.addAttribute("appDefinition", appDef);
        model.addAttribute("formDefinition", new FormDefinition());
        model.addAttribute("activityDefId", activityDefId);
        model.addAttribute("processDefId", processDefId);
        return "console/apps/formCreate";
    }
View Full Code Here

    @RequestMapping(value = "/console/app/(*:appId)/(~:version)/form/(*:formId)/update", method = RequestMethod.POST)
    public String consoleFormUpdate(@RequestParam(value = "appId") String appId, @RequestParam(value = "version", required = false) String version, @RequestParam(value = "formId") String formId, @RequestParam(value = "json") String json) {
        AppDefinition appDef = appService.getAppDefinition(appId, version);

        // load existing form definition and update fields
        FormDefinition formDef = formDefinitionDao.loadById(formId, appDef);
        Form form = (Form) formService.createElementFromJson(json);
        formDef.setName(form.getPropertyString("name"));
        formDef.setTableName(form.getPropertyString("tableName"));
        formDef.setJson(PropertyUtil.propertiesJsonStoreProcessing(formDef.getJson(), json));

        // update
        formDefinitionDao.update(formDef);
        formDataDao.clearFormCache(form);
        return "console/apps/dialogClose";
View Full Code Here

TOP

Related Classes of org.joget.apps.app.model.FormDefinition

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.