Package com.denimgroup.threadfix.service.defects.utils

Examples of com.denimgroup.threadfix.service.defects.utils.DynamicFormField


        model.addAttribute("periodTypes", ScheduledPeriodType.values());
        model.addAttribute("scheduledDays", DayInWeek.values());
    }

    private void addAdditionalScannerInfoField(@Nonnull List<DynamicFormField> formFields){
        DynamicFormField additionalScannerInfoField = new DynamicFormField();
        additionalScannerInfoField.setName("AdditionalScannerInfo");
        additionalScannerInfoField.setLabel("Additional Scanner Info");
        additionalScannerInfoField.setRequired(false);
        additionalScannerInfoField.setType("checkbox");
        additionalScannerInfoField.setActive(true);
        additionalScannerInfoField.setEditable(true);
        additionalScannerInfoField.setSupportsMultivalue(false);

        formFields.add(additionalScannerInfoField);
    }
View Full Code Here


            if (editableFields != null) {
                addAdditionalScannerInfoField(editableFields);

                //remove Order field in Version One dynamic form
                if (dt.getClass().equals(VersionOneDefectTracker.class)) {
                    DynamicFormField orderField = null;
                    for (DynamicFormField field : editableFields) {
                        if (field.getName().equals("Order")) {
                            orderField = field;
                        }
                    }
View Full Code Here

    }

    private List<DynamicFormField> convertToGenericField(List<AttributeDefinition> attributeDefinitions) {
        List<DynamicFormField> dynamicFormFields = list();
        for (AttributeDefinition attr : attributeDefinitions) {
            DynamicFormField genericField = new DynamicFormField();
            genericField.setActive(true);
            genericField.setEditable(!attr.isReadOnly());
            genericField.setLabel(attr.getName());
            genericField.setName(attr.getName());
            genericField.setType(attr.getRelationType());
            genericField.setRequired(attr.isRequired());
            genericField.setSupportsMultivalue(attr.isMultiValue());
            genericField.setOptionsMap(getFieldOptions(attr));

            genericField.setError("required", "This field cannot be empty.");

            dynamicFormFields.add(genericField);
        }

        return dynamicFormFields;
View Full Code Here

    private List<DynamicFormField> convertToGenericField() {
        if (editableFieldsList == null)
            return null;
        List<DynamicFormField> dynamicFormFields = list();
        for (Fields.Field hpqcField : editableFieldsList) {
            DynamicFormField genericField = new DynamicFormField();
            genericField.setActive(hpqcField.isActive());
            genericField.setEditable(hpqcField.isEditable());
            genericField.setLabel(hpqcField.getLabel());
            genericField.setMaxLength(hpqcField.getSize());
            genericField.setName(hpqcField.getName());
            genericField.setRequired(hpqcField.isRequired());
            genericField.setSupportsMultivalue(hpqcField.isSupportsMultivalue());
            genericField.setOptionsMap(getFieldOptions(hpqcField));
            genericField.setType(hpqcField.getType());

            genericField.setError("required", "This field cannot be empty.");
            genericField.setError("maxlength", "Input up to " + hpqcField.getSize() +" characters only.");

            dynamicFormFields.add(genericField);
        }

        return dynamicFormFields;
View Full Code Here

                        if ("array".equals(type) && "attachment".equals(jsonField.getSchema().getItems())) {
                            continue; // you can't make attachments required and we don't support uploads.
                        }

                        DynamicFormField field = new DynamicFormField();

                        field.setRequired(jsonField.isRequired());
                        if (jsonField.isRequired()) {
                            field.setError("required", "This field cannot be empty.");
                        }

                        field.setName(entry.getKey());
                        field.setLabel(jsonField.getName());
                        field.setActive(true);
                        field.setEditable(true);

                        if (jsonField.getAllowedValues() != null && !jsonField.getAllowedValues().isEmpty()) {

                            if (MULTISELECT.equals(jsonField.getSchema().getCustom())) {
                                field.setSupportsMultivalue(true);
                            }
                            if (MULTI_CHECKBOX.equals(jsonField.getSchema().getCustom())) {
                                field.setSupportsMultivalue(true);
                                field.setType("checklist");
                            } else if (CASCADING_SELECT.equals(jsonField.getSchema().getCustom())) {
                                field.setType("select");
                            } else {
                                field.setType("select");
                            }

                            field.setOptionsMap(jsonField.getOptionsMap());
                        } else if (type.equals("timetracking")) {
                            LOG.debug("Adding timetracking fields (x2)");

                            DynamicFormField originalEstimate = new DynamicFormField();

                            originalEstimate.setRequired(jsonField.isRequired());
                            originalEstimate.setName("timetracking_originalestimate");
                            originalEstimate.setLabel("Original Estimate");
                            originalEstimate.setActive(true);
                            originalEstimate.setEditable(true);
                            originalEstimate.setValidate(TIMETRACKING_REGEX);
                            originalEstimate.setType("text");
                            originalEstimate.setPlaceholder(PLACEHOLDER_TEXT);
                            originalEstimate.setError("pattern", TIMETRACKING_ERROR);
                            originalEstimate.setError("required", "This field cannot be empty.");
                            fieldList.add(originalEstimate);

                            DynamicFormField remainingEstimate = new DynamicFormField();

                            remainingEstimate.setRequired(jsonField.isRequired());
                            remainingEstimate.setName("timetracking_remainingestimate");
                            remainingEstimate.setLabel("Remaining Estimate");
                            remainingEstimate.setActive(true);
                            remainingEstimate.setValidate(TIMETRACKING_REGEX);
                            remainingEstimate.setPlaceholder(PLACEHOLDER_TEXT);
                            remainingEstimate.setEditable(true);
                            remainingEstimate.setType("text");
                            remainingEstimate.setError("required", "This field cannot be empty.");
                            remainingEstimate.setError("pattern", TIMETRACKING_ERROR);
                            fieldList.add(remainingEstimate);
                            continue;
                        } else if (type.equals("string")) {

                            if (URL_TYPE.equals(jsonField.getSchema().getCustom())) {
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.service.defects.utils.DynamicFormField

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.