From 84c2823e71d7751859e6cbdda4341082876ddfae Mon Sep 17 00:00:00 2001 From: M1044402 Date: Wed, 2 Dec 2020 12:12:59 +0530 Subject: [PATCH 1/5] MOSIP-10243 : Fixed iris image issue in preview --- .../device/BiometricsController.java | 118 ++++++++++++++++-- .../util/acktemplate/TemplateGenerator.java | 51 +++++--- 2 files changed, 139 insertions(+), 30 deletions(-) diff --git a/registration/registration-client/src/main/java/io/mosip/registration/controller/device/BiometricsController.java b/registration/registration-client/src/main/java/io/mosip/registration/controller/device/BiometricsController.java index a000d235326..b532a2eb4be 100644 --- a/registration/registration-client/src/main/java/io/mosip/registration/controller/device/BiometricsController.java +++ b/registration/registration-client/src/main/java/io/mosip/registration/controller/device/BiometricsController.java @@ -1348,6 +1348,22 @@ public void handle(WorkerStateEvent t) { } addBioStreamImage(currentSubType, currentModality, registrationDTOBiometricsList.get(0).getNumOfRetries(), byteimage); + + if (currentModality.equalsIgnoreCase(RegistrationConstants.IRIS_DOUBLE) + && bioService.isMdmEnabled()) { + + for (BiometricsDto biometricsDto : registrationDTOBiometricsList) { + byteimage = extractIrisImageData(biometricsDto.getAttributeISO()); + + if (byteimage != null) { + addRegistrationStreamImage(currentSubType, + biometricsDto.getBioAttribute(), + registrationDTOBiometricsList.get(0).getNumOfRetries(), + byteimage); + } + } + } + } catch (IOException exception) { LOGGER.error(LOG_REG_BIOMETRIC_CONTROLLER, APPLICATION_NAME, APPLICATION_ID, ExceptionUtils.getStackTrace(exception)); @@ -1950,22 +1966,26 @@ public void addBioStreamImage(String subType, String modality, int attempt, byte String imagePath = getStubStreamImagePath(modality); STREAM_IMAGES.put(String.format("%s_%s_%s", subType, modality, attempt), new Image(this.getClass().getResourceAsStream(imagePath))); - if (getRegistrationDTOFromSession() != null) { - getRegistrationDTOFromSession().streamImages.put( - String.format("%s_%s_%s", subType, - isFace(modality) ? RegistrationConstants.FACE_FULLFACE : modality, attempt), - IOUtils.toByteArray(this.getClass().getResourceAsStream(imagePath))); - } + + addRegistrationStreamImage(subType, isFace(modality) ? RegistrationConstants.FACE_FULLFACE : modality, + attempt, IOUtils.toByteArray(this.getClass().getResourceAsStream(imagePath))); + } else { STREAM_IMAGES.put(String.format("%s_%s_%s", subType, modality, attempt), new Image(new ByteArrayInputStream(streamImage))); - if (getRegistrationDTOFromSession() != null) { - getRegistrationDTOFromSession().streamImages.put( - String.format("%s_%s_%s", subType, - isFace(modality) ? RegistrationConstants.FACE_FULLFACE : modality, attempt), - streamImage); - } + + addRegistrationStreamImage(subType, isFace(modality) ? RegistrationConstants.FACE_FULLFACE : modality, + attempt, streamImage); + + } + } + + private void addRegistrationStreamImage(String subType, String modality, int attempt, byte[] streamImage) { + if (getRegistrationDTOFromSession() != null) { + getRegistrationDTOFromSession().streamImages.put(String.format("%s_%s_%s", subType, modality, attempt), + streamImage); } + } public Image getBioStreamImage(String subType, String modality, int attempt) { @@ -2673,6 +2693,80 @@ public byte[] extractFaceImageData(byte[] decodedBioValue) { return null; } + public byte[] extractIrisImageData(byte[] decodedBioValue) { + + LOGGER.info(LOG_REG_BIOMETRIC_CONTROLLER, APPLICATION_NAME, APPLICATION_ID, + "Extracting iris image from decode bio value"); + + try (DataInputStream din = new DataInputStream(new ByteArrayInputStream(decodedBioValue))) { + + // general header parsing + byte[] formatIdentifier = new byte[4]; + din.read(formatIdentifier, 0, formatIdentifier.length); + + LOGGER.info(LOG_REG_BIOMETRIC_CONTROLLER, APPLICATION_NAME, APPLICATION_ID, + "formatIdentifier >>>> " + new String(formatIdentifier)); + + int version = din.readInt(); + int recordLength = din.readInt(); + short noOfRepresentations = din.readShort(); + byte certificationFlag = din.readByte(); + + // 1 -- left / right + // 2 -- both left and right + // 0 -- unknown + byte noOfIrisRepresented = din.readByte(); + + for (int i = 0; i < noOfRepresentations; i++) { + // Reading representation header + int representationLength = din.readInt(); + + byte[] captureDetails = new byte[14]; + din.read(captureDetails, 0, captureDetails.length); + + // qualityBlock + byte noOfQualityBlocks = din.readByte(); + if (noOfQualityBlocks > 0) { + byte[] qualityBlocks = new byte[noOfQualityBlocks * 5]; + din.read(qualityBlocks, 0, qualityBlocks.length); + } + + short representationSequenceNo = din.readShort(); + + // 0 -- undefined + // 1 -- right + // 2 - left + byte eyeLabel = din.readByte(); + + byte imageType = din.readByte(); // cropped / uncropped + + // 2 -- raw + // 10 -- jpeg2000 + // 14 -- png + byte imageFormat = din.readByte(); + + byte[] otherDetails = new byte[24]; + din.read(otherDetails, 0, otherDetails.length); + + int imageLength = din.readInt(); + byte[] image = new byte[imageLength]; + din.read(image, 0, image.length); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ImageIO.write(ImageIO.read(new ByteArrayInputStream(image)), "jpg", baos); + + LOGGER.info(LOG_REG_BIOMETRIC_CONTROLLER, APPLICATION_NAME, APPLICATION_ID, "Converted JP2 to jpg"); + + return baos.toByteArray(); + } + } catch (Exception exception) { + LOGGER.error(LOG_REG_BIOMETRIC_CONTROLLER, APPLICATION_NAME, APPLICATION_ID, + "Error while parsing iso to jpg : " + ExceptionUtils.getStackTrace(exception)); + + } + return null; + } + private Pane getExceptionImagePane(String modality) { Pane exceptionImagePane = null; diff --git a/registration/registration-services/src/main/java/io/mosip/registration/util/acktemplate/TemplateGenerator.java b/registration/registration-services/src/main/java/io/mosip/registration/util/acktemplate/TemplateGenerator.java index 4137e41db56..b4fbee5c91b 100644 --- a/registration/registration-services/src/main/java/io/mosip/registration/util/acktemplate/TemplateGenerator.java +++ b/registration/registration-services/src/main/java/io/mosip/registration/util/acktemplate/TemplateGenerator.java @@ -420,9 +420,10 @@ private void setUpBiometricData(Map templateValues, Registration templateValues.put(RegistrationConstants.TEMPLATE_PHOTO_LOCAL_LANG, getSecondaryLanguageLabel("individualphoto")); + BiometricsDto biometricsDto = capturedFace.get(0); setPreviewBiometricImage(templateValues, RegistrationConstants.TEMPLATE_APPLICANT_IMAGE_SOURCE, - RegistrationConstants.FACE_IMG_PATH, response, - getStreamImageBytes(capturedFace.get(0), registration)); + RegistrationConstants.FACE_IMG_PATH, response, getStreamImageBytes(biometricsDto.getSubType(), + biometricsDto.getModalityName(), biometricsDto.getNumOfRetries(), registration)); } else { templateValues.put("uinUpdateWithoutBiometrics", RegistrationConstants.TEMPLATE_STYLE_HIDE_PROPERTY); } @@ -431,9 +432,8 @@ private void setUpBiometricData(Map templateValues, Registration } } - private byte[] getStreamImageBytes(BiometricsDto biometricsDto, RegistrationDTO registration) { - return registration.streamImages.get(String.format("%s_%s_%s", biometricsDto.getSubType(), - biometricsDto.getModalityName(), biometricsDto.getNumOfRetries())); + private byte[] getStreamImageBytes(String subType, String modality, int retry, RegistrationDTO registration) { + return registration.streamImages.get(String.format("%s_%s_%s", subType, modality, retry)); } private void setFaceTemplateValues(Map templateValues, List capturedFace, @@ -449,14 +449,16 @@ private void setFaceTemplateValues(Map templateValues, List templateValues, List biometrics = capturedFingers.stream() .filter(b -> b.getModalityName().equalsIgnoreCase("FINGERPRINT_SLAB_LEFT")).findFirst(); if (biometrics.isPresent()) { - imageBytes = getStreamImageBytes(biometrics.get(), registration); + + BiometricsDto biometricsDto = biometrics.get(); + imageBytes = getStreamImageBytes(biometricsDto.getSubType(), + biometricsDto.getModalityName(), biometricsDto.getNumOfRetries(), registration); } } setPreviewBiometricImage(templateValues, RegistrationConstants.TEMPLATE_CAPTURED_LEFT_SLAP, @@ -531,7 +536,10 @@ private void setFingerTemplateValues(Map templateValues, List b.getModalityName().equalsIgnoreCase("FINGERPRINT_SLAB_RIGHT")) .findFirst(); if (biometrics.isPresent()) { - imageBytes = getStreamImageBytes(biometrics.get(), registration); + + BiometricsDto biometricsDto = biometrics.get(); + imageBytes = getStreamImageBytes(biometricsDto.getSubType(), + biometricsDto.getModalityName(), biometricsDto.getNumOfRetries(), registration); } } setPreviewBiometricImage(templateValues, RegistrationConstants.TEMPLATE_CAPTURED_RIGHT_SLAP, @@ -565,7 +573,10 @@ private void setFingerTemplateValues(Map templateValues, List biometrics = capturedFingers.stream() .filter(b -> b.getModalityName().toLowerCase().contains("thumb")).findFirst(); if (biometrics.isPresent()) { - imageBytes = getStreamImageBytes(biometrics.get(), registration); + + BiometricsDto biometricsDto = biometrics.get(); + imageBytes = getStreamImageBytes(biometricsDto.getSubType(), + biometricsDto.getModalityName(), biometricsDto.getNumOfRetries(), registration); } } setPreviewBiometricImage(templateValues, RegistrationConstants.TEMPLATE_CAPTURED_THUMBS, @@ -648,11 +659,13 @@ private void setIrisTemplateValues(Map templateValues, List b.getBioAttribute().equalsIgnoreCase("leftEye")).findFirst().get(); setPreviewBiometricImage(templateValues, RegistrationConstants.TEMPLATE_CAPTURED_LEFT_EYE, RegistrationConstants.LEFT_IRIS_IMG_PATH, response, - getStreamImageBytes(capturedIris.stream() - .filter(b -> b.getBioAttribute().equalsIgnoreCase("leftEye")).findFirst().get(), - registration)); + getStreamImageBytes(biometricsDto.getSubType(), biometricsDto.getBioAttribute(), + biometricsDto.getNumOfRetries(), registration)); } } if (exceptionResult.isPresent()) { @@ -690,11 +703,13 @@ private void setIrisTemplateValues(Map templateValues, List b.getBioAttribute().equalsIgnoreCase("rightEye")).findFirst().get(); setPreviewBiometricImage(templateValues, RegistrationConstants.TEMPLATE_CAPTURED_RIGHT_EYE, RegistrationConstants.RIGHT_IRIS_IMG_PATH, response, - getStreamImageBytes(capturedIris.stream() - .filter(b -> b.getBioAttribute().equalsIgnoreCase("rightEye")).findFirst().get(), - registration)); + getStreamImageBytes(biometricsDto.getSubType(), biometricsDto.getBioAttribute(), + biometricsDto.getNumOfRetries(), registration)); } } From 1714964f33ce215991ebcda6017718d21d781b7f Mon Sep 17 00:00:00 2001 From: M1044402 Date: Wed, 2 Dec 2020 15:27:21 +0530 Subject: [PATCH 2/5] MOSIP-10008 : Fixed time zone issue in home page --- .../controller/reg/PacketHandlerController.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/registration/registration-client/src/main/java/io/mosip/registration/controller/reg/PacketHandlerController.java b/registration/registration-client/src/main/java/io/mosip/registration/controller/reg/PacketHandlerController.java index 6494c85253a..0eeb56c869a 100644 --- a/registration/registration-client/src/main/java/io/mosip/registration/controller/reg/PacketHandlerController.java +++ b/registration/registration-client/src/main/java/io/mosip/registration/controller/reg/PacketHandlerController.java @@ -148,8 +148,9 @@ public void setLastUpdateTime() { String latestUpdateTime = timestamps.stream().sorted((timestamp1, timestamp2) -> Timestamp .valueOf(timestamp2).compareTo(Timestamp.valueOf(timestamp1))).findFirst().get(); - lastSyncTime.setText(Timestamp.valueOf(latestUpdateTime).toLocalDateTime().format( - DateTimeFormatter.ofPattern(RegistrationConstants.ONBOARD_LAST_BIOMETRIC_UPDTAE_FORMAT))); + lastSyncTime.setText(Timestamp.valueOf(latestUpdateTime).toLocalDateTime() + .format(DateTimeFormatter.ofPattern(RegistrationConstants.ONBOARD_LAST_BIOMETRIC_UPDTAE_FORMAT)) + + " (UTC)"); setLastPreRegPacketDownloadedTime(); } @@ -331,7 +332,7 @@ public void initialize(URL location, ResourceBundle resources) { DateTimeFormatter format = DateTimeFormatter .ofPattern(RegistrationConstants.ONBOARD_LAST_BIOMETRIC_UPDTAE_FORMAT); lastBiometricTime - .setText(RegistrationUIConstants.LAST_DOWNLOADED + " " + ts.toLocalDateTime().format(format)); + .setText(RegistrationUIConstants.LAST_DOWNLOADED + " " + ts.toLocalDateTime().format(format)+ " (UTC)"); } if (!(getValueFromApplicationContext(RegistrationConstants.LOST_UIN_CONFIG_FLAG)) From 91dba44adb60b1c1b33eed47e7d338226be2e6e8 Mon Sep 17 00:00:00 2001 From: M1044402 Date: Wed, 2 Dec 2020 16:12:39 +0530 Subject: [PATCH 3/5] MOSIP-10008: Fixed utc time zone in preview and ack --- .../reg/PacketHandlerController.java | 6 ++-- .../constants/RegistrationConstants.java | 5 +++- .../util/acktemplate/TemplateGenerator.java | 29 +++++++++++++------ 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/registration/registration-client/src/main/java/io/mosip/registration/controller/reg/PacketHandlerController.java b/registration/registration-client/src/main/java/io/mosip/registration/controller/reg/PacketHandlerController.java index 0eeb56c869a..935607f9dc9 100644 --- a/registration/registration-client/src/main/java/io/mosip/registration/controller/reg/PacketHandlerController.java +++ b/registration/registration-client/src/main/java/io/mosip/registration/controller/reg/PacketHandlerController.java @@ -150,7 +150,7 @@ public void setLastUpdateTime() { lastSyncTime.setText(Timestamp.valueOf(latestUpdateTime).toLocalDateTime() .format(DateTimeFormatter.ofPattern(RegistrationConstants.ONBOARD_LAST_BIOMETRIC_UPDTAE_FORMAT)) - + " (UTC)"); + + RegistrationConstants.UTC_APPENDER); setLastPreRegPacketDownloadedTime(); } @@ -331,8 +331,8 @@ public void initialize(URL location, ResourceBundle resources) { if (ts != null) { DateTimeFormatter format = DateTimeFormatter .ofPattern(RegistrationConstants.ONBOARD_LAST_BIOMETRIC_UPDTAE_FORMAT); - lastBiometricTime - .setText(RegistrationUIConstants.LAST_DOWNLOADED + " " + ts.toLocalDateTime().format(format)+ " (UTC)"); + lastBiometricTime.setText(RegistrationUIConstants.LAST_DOWNLOADED + " " + + ts.toLocalDateTime().format(format) + RegistrationConstants.UTC_APPENDER); } if (!(getValueFromApplicationContext(RegistrationConstants.LOST_UIN_CONFIG_FLAG)) diff --git a/registration/registration-services/src/main/java/io/mosip/registration/constants/RegistrationConstants.java b/registration/registration-services/src/main/java/io/mosip/registration/constants/RegistrationConstants.java index 2f8a7096bd7..c3673ea598e 100644 --- a/registration/registration-services/src/main/java/io/mosip/registration/constants/RegistrationConstants.java +++ b/registration/registration-services/src/main/java/io/mosip/registration/constants/RegistrationConstants.java @@ -646,7 +646,7 @@ private RegistrationConstants() { public static final String TEMPLATE_PHOTO_USER_LANG = "PhotoPrim"; public static final String TEMPLATE_PHOTO_LOCAL_LANG = "PhotoSec"; public static final String TEMPLATE_APPLICANT_IMAGE_SOURCE = "ApplicantImageSource"; - public static final String TEMPLATE_DATE_FORMAT = "dd/MM/yyyy"; + public static final String TEMPLATE_DATE_FORMAT = "dd/MM/yyyy hh:mm a"; public static final String TEMPLATE_JPG_IMAGE_ENCODING = "data:image/jpg;base64,"; public static final String TEMPLATE_PNG_IMAGE_ENCODING = "data:image/png;base64,"; public static final String TEMPLATE_CROSS_MARK = "✘"; @@ -1811,4 +1811,7 @@ public static List fieldsToExclude() { // UI Schema field group name public static final String UI_SCHEMA_GROUP_FULL_NAME = "FullName"; public static final String MVEL_TYPE = "MVEL"; + + public static final String UTC_APPENDER = " (UTC)"; + } diff --git a/registration/registration-services/src/main/java/io/mosip/registration/util/acktemplate/TemplateGenerator.java b/registration/registration-services/src/main/java/io/mosip/registration/util/acktemplate/TemplateGenerator.java index b4fbee5c91b..1fb16a17a80 100644 --- a/registration/registration-services/src/main/java/io/mosip/registration/util/acktemplate/TemplateGenerator.java +++ b/registration/registration-services/src/main/java/io/mosip/registration/util/acktemplate/TemplateGenerator.java @@ -14,6 +14,9 @@ import java.math.BigInteger; import java.text.MessageFormat; import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.ZoneOffset; +import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Comparator; import java.util.Date; @@ -44,6 +47,7 @@ import io.mosip.kernel.core.qrcodegenerator.spi.QrCodeGenerator; import io.mosip.kernel.core.templatemanager.spi.TemplateManager; import io.mosip.kernel.core.templatemanager.spi.TemplateManagerBuilder; +import io.mosip.kernel.core.util.DateUtils; import io.mosip.kernel.qrcode.generator.zxing.constant.QrVersion; import io.mosip.registration.config.AppConfig; import io.mosip.registration.constants.RegistrationConstants; @@ -314,7 +318,8 @@ private void setUpBiometricData(Map templateValues, Registration Map fieldTemplateValues = new HashMap(); UiSchemaDTO field = fields.stream().filter(f -> f.getId().equals(fieldId)).findFirst().get(); fieldTemplateValues.put("BiometricsFieldPrimLabel", field.getLabel().get("primary")); - fieldTemplateValues.put("BiometricsFieldSecLabel", isLocalLanguageAvailable() ? field.getLabel().get("secondary") : RegistrationConstants.EMPTY); + fieldTemplateValues.put("BiometricsFieldSecLabel", + isLocalLanguageAvailable() ? field.getLabel().get("secondary") : RegistrationConstants.EMPTY); List dataCaptured = biometricDetails.get(fieldId); @@ -813,8 +818,10 @@ private void setUpDemographicInfo(RegistrationDTO registration, Map getSchemaFields(double idVersion) throws RegBaseChecke private boolean isLocalLanguageAvailable() { String platformLanguageCode = ApplicationContext.applicationLanguage(); String localLanguageCode = ApplicationContext.localLanguage(); - + if (localLanguageCode != null && !localLanguageCode.isEmpty()) { if (!platformLanguageCode.equalsIgnoreCase(localLanguageCode)) { return true; } } - + return false; } } \ No newline at end of file From 81fca0f3721ccd898de8d6c2713343120c7a9bdc Mon Sep 17 00:00:00 2001 From: M1044402 Date: Wed, 2 Dec 2020 16:35:15 +0530 Subject: [PATCH 4/5] MOSIP-10007 : Fixed child photo in preview --- .../registration/util/acktemplate/TemplateGenerator.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/registration/registration-services/src/main/java/io/mosip/registration/util/acktemplate/TemplateGenerator.java b/registration/registration-services/src/main/java/io/mosip/registration/util/acktemplate/TemplateGenerator.java index 1fb16a17a80..fa8d61457a4 100644 --- a/registration/registration-services/src/main/java/io/mosip/registration/util/acktemplate/TemplateGenerator.java +++ b/registration/registration-services/src/main/java/io/mosip/registration/util/acktemplate/TemplateGenerator.java @@ -429,12 +429,14 @@ private void setUpBiometricData(Map templateValues, Registration setPreviewBiometricImage(templateValues, RegistrationConstants.TEMPLATE_APPLICANT_IMAGE_SOURCE, RegistrationConstants.FACE_IMG_PATH, response, getStreamImageBytes(biometricsDto.getSubType(), biometricsDto.getModalityName(), biometricsDto.getNumOfRetries(), registration)); - } else { - templateValues.put("uinUpdateWithoutBiometrics", RegistrationConstants.TEMPLATE_STYLE_HIDE_PROPERTY); } ((List) templateValues.get("biometricsData")).add(fieldTemplateValues); } + + if (templateValues.get(RegistrationConstants.TEMPLATE_APPLICANT_IMAGE_SOURCE) == null) { + templateValues.put("uinUpdateWithoutBiometrics", RegistrationConstants.TEMPLATE_STYLE_HIDE_PROPERTY); + } } private byte[] getStreamImageBytes(String subType, String modality, int retry, RegistrationDTO registration) { @@ -822,7 +824,6 @@ private void setUpDemographicInfo(RegistrationDTO registration, Map Date: Wed, 2 Dec 2020 17:07:27 +0530 Subject: [PATCH 5/5] MOSIP-10227 : Fixed blacklisted error message --- .../controller/BaseController.java | 1 + .../controller/reg/Validations.java | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/registration/registration-client/src/main/java/io/mosip/registration/controller/BaseController.java b/registration/registration-client/src/main/java/io/mosip/registration/controller/BaseController.java index ff68ccce919..d536e030843 100644 --- a/registration/registration-client/src/main/java/io/mosip/registration/controller/BaseController.java +++ b/registration/registration-client/src/main/java/io/mosip/registration/controller/BaseController.java @@ -513,6 +513,7 @@ protected void generateAlert(Pane parentPane, String id, String context) { if (!(label.isVisible() && id.equals(RegistrationConstants.DOB))) { String[] split = context.split(type); label.setText(split[0]); + label.setWrapText(true); } Tooltip tool = new Tooltip(context.contains(type) ? context.split(type)[0] : context); diff --git a/registration/registration-client/src/main/java/io/mosip/registration/controller/reg/Validations.java b/registration/registration-client/src/main/java/io/mosip/registration/controller/reg/Validations.java index e7fea9aba4d..bcc2ed69c69 100644 --- a/registration/registration-client/src/main/java/io/mosip/registration/controller/reg/Validations.java +++ b/registration/registration-client/src/main/java/io/mosip/registration/controller/reg/Validations.java @@ -336,15 +336,18 @@ private boolean languageSpecificValidation(Pane parentPane, TextField node, Stri id.replaceAll(RegistrationConstants.ON_TYPE, RegistrationConstants.EMPTY) .replaceAll(RegistrationConstants.LOCAL_LANGUAGE, RegistrationConstants.EMPTY), RegistrationUIConstants.REGEX_TYPE); + + boolean isBlackListed = false; if (regex != null) { if (inputText.matches(regex)) { - isInputValid = validateBlackListedWords(parentPane, node, id, blackListedWords, showAlert, + isBlackListed = validateBlackListedWords(parentPane, node, id, blackListedWords, showAlert, String.format("%s %s %s", messageBundle.getString(RegistrationConstants.BLACKLISTED_1), getFromLabelMap(id), messageBundle.getString(RegistrationConstants.BLACKLISTED_2)), messageBundle.getString(RegistrationConstants.BLACKLISTED_ARE), messageBundle.getString(RegistrationConstants.BLACKLISTED_IS)); + isInputValid = isBlackListed; } else { isInputValid = false; } @@ -354,10 +357,13 @@ private boolean languageSpecificValidation(Pane parentPane, TextField node, Stri } if (!isInputValid) { - generateInvalidValueAlert(parentPane, node.getId(), - getFromLabelMap(label).concat(RegistrationConstants.SPACE) - .concat(messageBundle.getString(RegistrationConstants.REG_DDC_004)), - showAlert); + + if (isBlackListed) { + generateInvalidValueAlert( + parentPane, node.getId(), getFromLabelMap(label).concat(RegistrationConstants.SPACE) + .concat(messageBundle.getString(RegistrationConstants.REG_DDC_004)), + showAlert); + } if (isPreviousValid && !id.contains(RegistrationConstants.ON_TYPE)) { addInvalidInputStyleClass(parentPane, node, false); } @@ -378,7 +384,8 @@ private boolean languageSpecificValidation(Pane parentPane, TextField node, Stri private void addValidInputStyleClass(Pane parentPane, TextField node) { Label nodeLabel = (Label) parentPane.lookup("#" + node.getId() + "Label"); - if (nodeLabel == null && parentPane.getParent() != null && parentPane.getParent().getParent() != null && parentPane.getParent().getParent().getParent() != null) { + if (nodeLabel == null && parentPane.getParent() != null && parentPane.getParent().getParent() != null + && parentPane.getParent().getParent().getParent() != null) { nodeLabel = (Label) parentPane.getParent().getParent().getParent().lookup("#" + node.getId() + "Label"); } // node.requestFocus();