public AuditHelper.ValidationState getValidationState(ProposalDevelopmentDocumentForm form) { AuditHelper.ValidationState severityLevel = AuditHelper.ValidationState.OK; form.setAuditActivated(true); List<DataValidationItem> dataValidationItems = ((ProposalDevelopmentViewHelperServiceImpl) form.getViewHelperService()) .populateDataValidation(form); if (dataValidationItems != null && dataValidationItems.size() > 0) { for (DataValidationItem validationItem : dataValidationItems) { if (StringUtils.endsWith(validationItem.getSeverity(), Constants.AUDIT_ERRORS)) { severityLevel = AuditHelper.ValidationState.ERROR; break; } if (StringUtils.equals(validationItem.getSeverity(), Constants.AUDIT_WARNINGS)) { severityLevel = AuditHelper.ValidationState.WARNING; } } form.setDataValidationItems(dataValidationItems); } getGlobalVariableService().getMessageMap().clearErrorMessages(); return severityLevel; }
/** * Method calls the permissions service, where it will determine if any user permissions need to * be added and/or removed. * * @param pdForm ProposalDevelopmentDocumentForm that contains the permissions helper */ public void saveDocumentPermissions(ProposalDevelopmentDocumentForm pdForm) { List<String> editableLines = pdForm .getEditableCollectionLines() .get(Constants.PERMISSION_PROPOSAL_USERS_COLLECTION_PROPERTY_KEY); if (editableLines != null && editableLines.size() > 0) { getGlobalVariableService() .getMessageMap() .putErrorForSectionId( Constants.PERMISSION_PROPOSAL_USERS_COLLECTION_ID_KEY, KeyConstants.ERROR_UNFINISHED_PERMISSIONS); } else if (arePermissionsValid( pdForm.getProposalDevelopmentDocument(), pdForm.getWorkingUserRoles())) { getProposalDevelopmentPermissionsService() .savePermissions( pdForm.getProposalDevelopmentDocument(), getProposalDevelopmentPermissionsService() .getPermissions(pdForm.getProposalDevelopmentDocument()), pdForm.getWorkingUserRoles()); } }