Package org.joget.apps.form.model

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


        ApplicationContext ac = AppUtil.getApplicationContext();
        FormService formService = (FormService) ac.getBean("formService");
        WorkflowManager workflowManager = (WorkflowManager) ac.getBean("workflowManager");

        Form form = null;
        WorkflowAssignment assignment = null;
        PackageActivityForm activityForm = null;
        FormData formData = new FormData();

        // get assignment by activity ID if available
View Full Code Here


        ApplicationContext ac = AppUtil.getApplicationContext();
        FormService formService = (FormService) ac.getBean("formService");
        WorkflowManager workflowManager = (WorkflowManager) ac.getBean("workflowManager");

        Form form = null;
        WorkflowAssignment assignment = null;
        FormData formData = new FormData();

        // get assignment by activity ID if available
        if (activityId != null && !activityId.trim().isEmpty()) {
View Full Code Here

     * Retrieves the form mapped to this menu item.
     * @param formData
     * @return
     */
    protected Form retrieveDataForm(FormData formData, String primaryKeyValue) {
        Form form = null;
        ApplicationContext ac = AppUtil.getApplicationContext();
        AppService appService = (AppService) ac.getBean("appService");
        FormService formService = (FormService) ac.getBean("formService");
        AppDefinition appDef = AppUtil.getCurrentAppDefinition();
        String formId = getPropertyString("formId");
View Full Code Here

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

        if (formData.getFormResult(AssignmentWithdrawButton.DEFAULT_ID) != null) {
View Full Code Here

     * Utility method to recursively find the parent Form for an element.
     * @param element
     * @return
     */
    public static Form findRootForm(Element element) {
        Form form = null;
        Element el = element;
        while (el != null && form == null) {
            if (el instanceof Form) {
                form = (Form) el;
                break;
View Full Code Here

        // get value
        String id = element.getPropertyString(FormUtil.PROPERTY_ID);
       
        String primaryKeyValue = element.getPrimaryKeyValue(formData);
        String uniqueId = "";
        Form rootForm = findRootForm(element);
        if (rootForm.getParent() != null) {
            uniqueId = rootForm.getCustomParameterName();
        }
        if (primaryKeyValue != null && !primaryKeyValue.equals(formData.getRequestParameter(uniqueId + FormUtil.FORM_META_ORIGINAL_ID))) {
            return true;
        }
View Full Code Here

    /**
     * Check a form is submitted or not
     * @param formData
     */
    public static boolean isFormSubmitted(Element element, FormData formData) {
        Form form = findRootForm(element);
        if (form != null) {
            String paramName = FormUtil.getElementParameterName(form);
            if (formData != null && formData.getRequestParameter(paramName+"_SUBMITTED") != null) {
                return true;
            }
View Full Code Here

        if (appDef != null && formDefId != null && !formDefId.isEmpty() && primaryKeyValue != null) {
            formDefinitionDao.getHibernateTemplate().execute(new HibernateCallback() {
                @SuppressWarnings("unchecked")
                public Object doInHibernate(Session s) throws HibernateException, SQLException {
                    // get root form
                    Form form = null;
                    FormData formData = new FormData();
                    formData.setPrimaryKeyValue(primaryKeyValue);
                    FormDefinition formDef = formDefinitionDao.loadById(formDefId, appDef);
                    if (formDef != null) {
                        String formJson = formDef.getJson();
View Full Code Here

                AppService appService = (AppService) AppUtil.getApplicationContext().getBean("appService");
               
                FormData formData = new FormData();
                String primaryKey = appService.getOriginProcessId(wfAssignment.getProcessId());
                formData.setPrimaryKeyValue(primaryKey);
                Form loadForm = appService.viewDataForm(appDef.getId(), appDef.getVersion().toString(), formDefId, null, null, null, formData, null, null);
               
                for (Object o : fields) {
                    Map mapping = (HashMap) o;
                    String fieldId = mapping.get("field").toString();
                       
View Full Code Here

            if (formList != null && !formList.isEmpty()) {
                for (FormDefinition formDef : formList) {
                    // get JSON
                    String json = formDef.getJson();
                    if (json != null) {
                        Form form = (Form) getFormService().createElementFromJson(json, false);
                        Collection<String> tempColumnList = new HashSet<String>();
                        findAllElementIds(form, tempColumnList);
                       
                        LogUtil.debug("", "Columns of Form \"" + formDef.getId() + "\" [" + formDef.getAppId() + " v" + formDef.getAppVersion() + "] - " + tempColumnList.toString());
                        for (String c : tempColumnList) {
View Full Code Here

TOP

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

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.