Package org.joget.apps.app.service

Examples of org.joget.apps.app.service.AppService


        if (!formDefId.isEmpty() && !field.isEmpty() && value != null) {
            try {
                AppDefinition appDef = AppUtil.getCurrentAppDefinition();
                ApplicationContext ac = AppUtil.getApplicationContext();
                AppService appService = (AppService) ac.getBean("appService");
                if (formDefId != null) {
                    String tableName = appService.getFormTableName(appDef, formDefId);

                    FormDataDao dao = (FormDataDao) ac.getBean("formDataDao");

                    FormRow formRow = dao.load(formDefId, tableName, value.toString());
View Full Code Here


    }

    protected String getSelectedFormTableName(String formDefId) {
        String tableName = null;
        AppDefinition appDef = AppUtil.getCurrentAppDefinition();
        AppService appService = (AppService) AppUtil.getApplicationContext().getBean("appService");
        if (formDefId != null) {
            tableName = appService.getFormTableName(appDef, formDefId);
        }
        return tableName;
    }
View Full Code Here

    }

    protected DataList getDataList() {
        // get datalist
        ApplicationContext ac = AppUtil.getApplicationContext();
        AppService appService = (AppService) ac.getBean("appService");
        DataListService dataListService = (DataListService) ac.getBean("dataListService");
        String json = AppUtil.readPluginResource(getClass().getName(), "/properties/userview/inboxMenuListJson.json", null, true, "message/userview/inboxMenu");
        DataList dataList = dataListService.fromJson(json);

        return dataList;
View Full Code Here

            } 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();
                }
            }

            if (packageId != null || processDefId != null) {
View Full Code Here

        } 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

        String activityId = assignment.getActivityId();
        String formUrl = addParamToUrl(getUrl(), "_action", "submit");
        formUrl = addParamToUrl(formUrl, "_mode", "assignment");
        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);
        return activityForm;
    }
View Full Code Here

    }

    protected Form submitAssignmentForm(FormData formData, WorkflowAssignment assignment, PackageActivityForm activityForm) {
        Form nextForm = null;
        ApplicationContext ac = AppUtil.getApplicationContext();
        AppService appService = (AppService) ac.getBean("appService");
        FormService formService = (FormService) ac.getBean("formService");
        WorkflowManager workflowManager = (WorkflowManager) ac.getBean("workflowManager");
        String activityId = assignment.getActivityId();
        String processId = assignment.getProcessId();

        // get form
        Form currentForm = activityForm.getForm();

        // submit form
        formData = formService.executeFormActions(currentForm, formData);
       
        setProperty("submitted", Boolean.TRUE);
        setProperty("redirectUrlAfterComplete", getUrl());
        setRedirectUrl(getUrl());

        // check for validation errors
        if (formData.getFormResult(AssignmentWithdrawButton.DEFAULT_ID) != null) {
            // withdraw assignment
            workflowManager.assignmentWithdraw(activityId);
        } else if (formData.getFormResult(AssignmentCompleteButton.DEFAULT_ID) != null) {
            // complete assignment
            Map<String, String> variableMap = AppUtil.retrieveVariableDataFromMap(getRequestParameters());
            formData = appService.completeAssignmentForm(currentForm, assignment, formData, variableMap);
           
            Map<String, String> errors = formData.getFormErrors();
           
            if (errors.isEmpty() && activityForm.isAutoContinue()) {
                // redirect to next activity if available
View Full Code Here

            String appVersion = request.getParameter("appVersion");
            try {
                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>();
View Full Code Here

                data.addFormError(id, errorMsg);
            } else {
                //check for duplicate value
                AppDefinition appDef = AppUtil.getCurrentAppDefinition();
                String tableName = null;
                AppService appService = (AppService) AppUtil.getApplicationContext().getBean("appService");

                if (formDefId != null) {
                    tableName = appService.getFormTableName(appDef, formDefId);
                }
                if (isDuplicate(formDefId, tableName, element, data, fieldId, values)) {
                    result = false;
                    data.addFormError(id, pm.getMessage("form.duplicatevaluevalidator.e.valueAlreadyExist", this.getClassName(), null));
                }
View Full Code Here

            }
            final Map<String, String> replace = replaceMap;
                   
            String appId = auditTrail.getAppId();
            String appVersion = auditTrail.getAppVersion();
            AppService appService = (AppService) AppUtil.getApplicationContext().getBean("appService");
            final AppDefinition appDef = appService.getAppDefinition(appId, appVersion);

            if (smtpHost == null || smtpHost.trim().length() == 0) {
                return null;
            }
View Full Code Here

TOP

Related Classes of org.joget.apps.app.service.AppService

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.