Package org.joget.apps.app.model

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


    @Override
    public boolean delete(String id, AppDefinition appDef) {
        boolean result = false;
        try {
            DatalistDefinition obj = loadById(id, appDef);

            // detach from app
            if (obj != null) {
                Collection<DatalistDefinition> list = appDef.getDatalistDefinitionList();
                for (DatalistDefinition object : list) {
                    if (obj.getId().equals(object.getId())) {
                        list.remove(obj);
                        break;
                    }
                }
                obj.setAppDefinition(null);

                // delete obj
                super.delete(getEntityName(), obj);
                result = true;
            }
View Full Code Here


        AppService appService = (AppService) ac.getBean("appService");
        DataListService dataListService = (DataListService) ac.getBean("dataListService");
        DatalistDefinitionDao datalistDefinitionDao = (DatalistDefinitionDao) ac.getBean("datalistDefinitionDao");
        String id = getPropertyString("datalistId");
        AppDefinition appDef = appService.getAppDefinition(getRequestParameterString("appId"), getRequestParameterString("appVersion"));
        DatalistDefinition datalistDefinition = datalistDefinitionDao.loadById(id, appDef);
        DataList dataList = dataListService.fromJson(datalistDefinition.getJson());
       
        if (getPropertyString(Userview.USERVIEW_KEY_NAME) != null && getPropertyString(Userview.USERVIEW_KEY_NAME).trim().length() > 0) {
            dataList.addBinderProperty(Userview.USERVIEW_KEY_NAME, getPropertyString(Userview.USERVIEW_KEY_NAME));
        }
        if (getKey() != null && getKey().trim().length() > 0) {
View Full Code Here

        AppDefinition appDef = appService.getAppDefinition(appId, version);
        map.addAttribute("appId", appId);
        map.addAttribute("appVersion", appDef.getVersion());
        map.addAttribute("appDefinition", appDef);

        DatalistDefinition datalist = datalistDefinitionDao.loadById(id, appDef);
        String listJson = null;
        if (json != null && !json.trim().isEmpty()) {
            // read custom JSON from request
            listJson = json;
        } else {
            // get JSON from form definition
            listJson = datalist.getJson();
        }

        map.addAttribute("id", id);
        map.addAttribute("datalist", datalist);
        map.addAttribute("json", PropertyUtil.propertiesJsonLoadProcessing(listJson));
View Full Code Here

    }

    @RequestMapping(value = "/console/app/(*:appId)/(~:version)/datalist/builderSave/(*:id)", method = RequestMethod.POST)
    public void save(Writer writer, @RequestParam("appId") String appId, @RequestParam(value = "version", required = false) String version, @RequestParam("id") String id, @RequestParam("json") String json) throws Exception {
        AppDefinition appDef = appService.getAppDefinition(appId, version);
        DatalistDefinition datalist = datalistDefinitionDao.loadById(id, appDef);
        DataList dlist = dataListService.fromJson(json);
        datalist.setName(dlist.getName());
        datalist.setDescription(dlist.getName());
        datalist.setJson(PropertyUtil.propertiesJsonStoreProcessing(datalist.getJson(), json));

        boolean success = datalistDefinitionDao.update(datalist);
        JSONObject jsonObject = new JSONObject();
        jsonObject.accumulate("success", success);
        jsonObject.write(writer);
View Full Code Here

            DataList dataList = new DataList();
            if (json != null && !json.trim().isEmpty()) {
               
                String tempJson = json;
                if (tempJson.contains(SecurityUtil.ENVELOPE) || tempJson.contains(PropertyUtil.PASSWORD_PROTECTED_VALUE)) {
                    DatalistDefinition datalistDef = datalistDefinitionDao.loadById(id, appDef);

                    if (datalistDef != null) {
                        tempJson = PropertyUtil.propertiesJsonStoreProcessing(datalistDef.getJson(), tempJson);
                    }
                }
               
                dataList = dataListService.fromJson(AppUtil.processHashVariable(tempJson, null, null, null));
                map.addAttribute("json", json);
View Full Code Here

                        String propName = paramName.substring(PREFIX_BINDER_PROPERTY.length());
                       
                        String value = CsvUtil.getDeliminatedString(paramValue);
                       
                        if (value.contains(SecurityUtil.ENVELOPE) || value.contains(PropertyUtil.PASSWORD_PROTECTED_VALUE)) {
                            DatalistDefinition datalist = datalistDefinitionDao.loadById(datalistId, appDef);
                           
                            if (datalist != null) {
                                value = PropertyUtil.propertiesJsonStoreProcessing(datalist.getJson(), value);
                            }
                        }
                       
                        binder.setProperty(propName, AppUtil.processHashVariable(value, null, null, null));
                    }
View Full Code Here

        if (json != null && json.trim().length() > 0) {
            try {
                String tempJson = json;
                if (tempJson.contains(SecurityUtil.ENVELOPE) || tempJson.contains(PropertyUtil.PASSWORD_PROTECTED_VALUE)) {
                    AppDefinition appDef = AppUtil.getCurrentAppDefinition();
                    DatalistDefinition datalist = datalistDefinitionDao.loadById(id, appDef);

                    if (datalist != null) {
                        tempJson = PropertyUtil.propertiesJsonStoreProcessing(datalist.getJson(), tempJson);
                    }
                }
               
                dataList = dataListService.fromJson(AppUtil.processHashVariable(tempJson, null, null, null));
                dataList.setId(id);
View Full Code Here

    }
   
    @RequestMapping("/app/(*:appId)/(~:appVersion)/datalist/embed")
    public String embedDatalist(ModelMap model, HttpServletResponse response, @RequestParam("appId") String appId, @RequestParam(value = "version", required = false) String version, HttpServletRequest request, @RequestParam("_submitButtonLabel") String buttonLabel, @RequestParam("_callback") String callback, @RequestParam("_setting") String callbackSetting, @RequestParam(required = false) String id, @RequestParam(value = "_listId", required = false) String listId, @RequestParam(value = "_type", required = false) String selectionType) throws JSONException {
        AppDefinition appDef = appService.getAppDefinition(appId, version);
        DatalistDefinition datalistDefinition = datalistDefinitionDao.loadById(listId, appDef);
        String json = datalistDefinition.getJson();
        DataList dataList = dataListService.fromJson(json);
        dataList.setSelectionType(selectionType);
       
        model.addAttribute("id", id);
        model.addAttribute("json", json);
View Full Code Here

        AppDefinition appDef = appService.getAppDefinition(appId, version);
        map.addAttribute("appId", appId);
        map.addAttribute("appVersion", appDef.getVersion());
        map.addAttribute("appDefinition", appDef);

        DatalistDefinition datalistDefinition = new DatalistDefinition();
        map.addAttribute("datalistDefinition", datalistDefinition);
        return "console/apps/datalistCreate";
    }
View Full Code Here

TOP

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

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.