Package org.joget.apps.app.model

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


        String packageId = null;
        String processDefId = null;
        String appFilter = getPropertyString(PROPERTY_FILTER);
        if (PROPERTY_FILTER_ALL.equals(appFilter)) {
            AppDefinition appDef = AppUtil.getCurrentAppDefinition();
            if (appDef != null) {
                PackageDefinition packageDef = appDef.getPackageDefinition();
                if (packageDef != null) {
                    packageId = packageDef.getId();
                }
            }
        } else if (PROPERTY_FILTER_PROCESS.equals(appFilter)) {
            String processId = getPropertyString("processId");
            AppDefinition appDef = AppUtil.getCurrentAppDefinition();
            if (appDef != null && processId != null && !processId.isEmpty()) {
                ApplicationContext ac = AppUtil.getApplicationContext();
                AppService appService = (AppService) ac.getBean("appService");
                WorkflowProcess process = appService.getWorkflowProcessForApp(appDef.getId(), appDef.getVersion().toString(), processId);
                processDefId = process.getId();
            }
        }
        int count = 0;
       
View Full Code Here


       
        return count;
    }

    protected String handleForm() {
        AppDefinition appDef = AppUtil.getCurrentAppDefinition();
        if ("submit".equals(getRequestParameterString("_action"))) {
            // only allow POST
            HttpServletRequest request = WorkflowUtil.getHttpServletRequest();
            if (request != null && !"POST".equalsIgnoreCase(request.getMethod())) {
                return "userview/plugin/unauthorized.jsp";
View Full Code Here

        formUrl = addParamToUrl(formUrl, "activityId", activityId);

        AppService appService;
        ApplicationContext ac = AppUtil.getApplicationContext();
        appService = (AppService) ac.getBean("appService");
        AppDefinition appDef = appService.getAppDefinitionForWorkflowActivity(activityId);
        FormService formService = (FormService) ac.getBean("formService");
       
        formData = formService.retrieveFormDataFromRequestMap(formData, getRequestParameters());
       
        PackageActivityForm activityForm = appService.viewAssignmentForm(appDef, assignment, formData, formUrl);
View Full Code Here

        return currentForm;

    }

    public String getPropertyOptions() {
        AppDefinition appDef = AppUtil.getCurrentAppDefinition();
        String appId = appDef.getId();
        String appVersion = appDef.getVersion().toString();
        Object[] arguments = new Object[]{PROPERTY_FILTER, PROPERTY_FILTER_ALL, PROPERTY_FILTER_PROCESS, appId, appVersion};
        String json = AppUtil.readPluginResource(getClass().getName(), "/properties/userview/inboxMenu.json", arguments, true, "message/userview/inboxMenu");
        return json;
    }
View Full Code Here

                JSONArray jsonArray = new JSONArray();

                ApplicationContext ac = AppUtil.getApplicationContext();
                AppService appService = (AppService) ac.getBean("appService");
                WorkflowManager workflowManager = (WorkflowManager) ac.getBean("workflowManager");
                AppDefinition appDef = appService.getAppDefinition(appId, appVersion);
                PackageDefinition packageDefinition = appDef.getPackageDefinition();
                Long packageVersion = (packageDefinition != null) ? packageDefinition.getVersion() : new Long(1);
                Collection<WorkflowProcess> processList = workflowManager.getProcessList(appId, packageVersion.toString());

                Map<String, String> empty = new HashMap<String, String>();
                empty.put("value", "");
View Full Code Here

            if (appVersion == null || appVersion == 0) {
                return "error404";
            }

            // retrieve app and userview
            AppDefinition appDef = appService.getAppDefinition(appId, appVersion.toString());
            if (appDef == null) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return null;
            }
            map.addAttribute("appId", appId);
            map.addAttribute("appDefinition", appDef);
            map.addAttribute("appVersion", appDef.getVersion());
            map.addAttribute("key", key);
            map.addAttribute("menuId", menuId);
            map.addAttribute("embed", embed);
            UserviewDefinition userview = userviewDefinitionDao.loadById(userviewId, appDef);
            if (userview != null) {
                String json = userview.getJson();
                map.addAttribute("userview", userviewService.createUserview(json, null, false, request.getContextPath(), request.getParameterMap(), key, embed));
            }

            return "ubuilder/login";
        } else if (savedUrl.contains("/web/mlogin") || savedUrl.contains("/web/embed/mlogin")) {
            Boolean embed = false;
            if (savedUrl.equals("/web/mlogin") || savedUrl.equals("/web/embed/mlogin")) {
                savedUrl = "";
            } else if (savedUrl.contains("/web/mlogin")) {
                savedUrl = savedUrl.substring(savedUrl.indexOf("/web/mlogin"));
                savedUrl = savedUrl.replace("/web/mlogin/", "");
            } else {
                savedUrl = savedUrl.substring(savedUrl.indexOf("/web/embed/mlogin"));
                savedUrl = savedUrl.replace("/web/embed/mlogin/", "");
                embed = true;
            }
           
            if (savedUrl.isEmpty()) {
                return "mobile/mLogin";
            }
           
            String[] urlKey = savedUrl.split("/");
            String appId = urlKey[0];
            String userviewId = urlKey[1];
            String key = null;
            String menuId = null;
            if (urlKey.length > 2) {
                key = urlKey[2];
               
                if (urlKey.length > 3) {
                    menuId = urlKey[3];
                }
            }

            Long appVersion = appService.getPublishedVersion(appId);
            if (appVersion == null || appVersion == 0) {
                return "error404";
            }

            // retrieve app and userview
            AppDefinition appDef = appService.getAppDefinition(appId, appVersion.toString());
            if (appDef == null) {
                response.sendError(HttpServletResponse.SC_NOT_FOUND);
                return null;
            }
            map.addAttribute("appId", appId);
            map.addAttribute("appDefinition", appDef);
            map.addAttribute("appVersion", appDef.getVersion());
            map.addAttribute("key", key);
            map.addAttribute("menuId", menuId);
            map.addAttribute("embed", embed);
            UserviewDefinition userview = userviewDefinitionDao.loadById(userviewId, appDef);
            if (userview != null) {
View Full Code Here

        // set flag in request
        FormUtil.setFormBuilderActive(true);

        // load form definition
        model.addAttribute("appId", appId);
        AppDefinition appDef = appService.getAppDefinition(appId, version);
        FormDefinition formDef = null;
        if (appDef == null) {
            // TODO: handle invalid app
        } else {
            model.addAttribute("appDefinition", appDef);
View Full Code Here

        try {
            FormUtil.setProcessedFormJson(json);

            model.addAttribute("appId", appId);
            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);
View Full Code Here

        try {
            FormUtil.setProcessedFormJson(json);

            model.addAttribute("appId", appId);
            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);
View Full Code Here

        return "fbuilder/previewElement";
    }
   
    @RequestMapping("/app/(*:appId)/(~:appVersion)/form/embed")
    public String appEmbedForm(ModelMap model, HttpServletRequest request, HttpServletResponse response, @RequestParam("appId") String appId, @RequestParam(value = "appVersion", required = false) String appVersion, @RequestParam("_submitButtonLabel") String buttonLabel, @RequestParam("_json") String json, @RequestParam("_callback") String callback, @RequestParam("_setting") String callbackSetting, @RequestParam(required = false) String id, @RequestParam(value = "_a", required = false) String action) throws JSONException {
        AppDefinition appDef = appService.getAppDefinition(appId, appVersion);
        AppUtil.setCurrentAppDefinition(appDef);
        return embedForm(model, request, response, buttonLabel, json, callback, callbackSetting, id, action);
    }
View Full Code Here

TOP

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

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.