Package com.sparc.knappsack.forms

Examples of com.sparc.knappsack.forms.KeyVaultEntryForm


            }
        }
        model.addAttribute("applicationTypes", applicationTypes);

        if (!model.containsAttribute("keyVaultEntryForm")) {
            KeyVaultEntryForm keyVaultEntryForm = new KeyVaultEntryForm();
            model.addAttribute("keyVaultEntryForm", keyVaultEntryForm);
        }

        return "manager/manageKeyVaultTH";
    }
View Full Code Here


        return KeyVaultEntryForm.class.isAssignableFrom(clazz);
    }

    @Override
    public void validate(Object target, Errors errors) {
        KeyVaultEntryForm form = (KeyVaultEntryForm) target;

        boolean isEdit = (form.getId() != null && form.getId() > 0);

        if (!isEdit && (form.getApplicationType() == null || !form.getApplicationType().isKeyVaultCandidate())) {
            errors.rejectValue(APPLICATION_TYPE_FIELD, "keyVaultEntryValidator.invalidApplicationType");
        }

        if (!StringUtils.hasText(form.getName())) {
            errors.rejectValue(NAME_FIELD, "keyVaultEntryValidator.invalidName");
        }

        if (!errors.hasFieldErrors(APPLICATION_TYPE_FIELD) && !isEdit) {
            switch (form.getApplicationType()) {
                case IOS:
                    validateIOS(form, errors);
                    break;
                default:
                    errors.rejectValue(APPLICATION_TYPE_FIELD, "keyVaultEntryValidator.invalidApplicationType");
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.forms.KeyVaultEntryForm

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.