Skip to content

Commit

Permalink
Merge pull request #1920 from Khuddusshariff0022/v1.2.0.1-selectedHan…
Browse files Browse the repository at this point in the history
…dels

[ MOSIP-35378 ] selected handles in uin generator stage.
  • Loading branch information
ase-101 authored Sep 20, 2024
2 parents 71fcda8 + 4ed866a commit cfe71a5
Show file tree
Hide file tree
Showing 8 changed files with 105 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM openjdk:11

ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME
LABEL source=${SOURCE}
LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

#Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image
#FROM openjdk:8-jdk-alpine

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,35 +463,48 @@ public MessageDTO process(MessageDTO object) {
return object;
}

private void loadDemographicIdentity(Map<String, String> fieldMap, JSONObject demographicIdentity) throws IOException, JSONException {
for (Map.Entry e : fieldMap.entrySet()) {
if (e.getValue() != null) {
String value = e.getValue().toString();
if (value != null) {
Object json = new JSONTokener(value).nextValue();
if (json instanceof org.json.JSONObject) {
HashMap<String, Object> hashMap = objectMapper.readValue(value, HashMap.class);
demographicIdentity.putIfAbsent(e.getKey(), hashMap);
}
else if (json instanceof JSONArray) {
List jsonList = new ArrayList<>();
JSONArray jsonArray = new JSONArray(value);
for (int i = 0; i < jsonArray.length(); i++) {
Object obj = jsonArray.get(i);
HashMap<String, Object> hashMap = objectMapper.readValue(obj.toString(), HashMap.class);
if(trimWhitespaces && hashMap.get("value") instanceof String) {
hashMap.put("value",((String)hashMap.get("value")).trim());
}
jsonList.add(hashMap);
}
demographicIdentity.putIfAbsent(e.getKey(), jsonList);
} else
demographicIdentity.putIfAbsent(e.getKey(), value);
} else
demographicIdentity.putIfAbsent(e.getKey(), value);
}
}
}
private void loadDemographicIdentity(Map<String, String> fieldMap, JSONObject demographicIdentity) throws IOException, JSONException {
for (Map.Entry e : fieldMap.entrySet()) {
if (e.getValue() == null) {
continue;
}

String value = e.getValue().toString();
if (value == null) {
demographicIdentity.putIfAbsent(e.getKey(), value);
continue;
}

Object json = new JSONTokener(value).nextValue();
if (json instanceof org.json.JSONObject) {
HashMap<String, Object> hashMap = objectMapper.readValue(value, HashMap.class);
demographicIdentity.putIfAbsent(e.getKey(), hashMap);
continue;
}

if (json instanceof JSONArray) {
List jsonList = new ArrayList<>();
JSONArray jsonArray = new JSONArray(value);
for (int i = 0; i < jsonArray.length(); i++) {
Object obj = jsonArray.get(i);
if (obj instanceof String) {
jsonList.add(obj);
} else {
HashMap<String, Object> hashMap = objectMapper.readValue(obj.toString(), HashMap.class);

if (trimWhitespaces && hashMap.containsKey("value") && hashMap.get("value") instanceof String) {
hashMap.put("value", ((String) hashMap.get("value")).trim());
}
jsonList.add(hashMap);
}
}
demographicIdentity.putIfAbsent(e.getKey(), jsonList);
}
else {
demographicIdentity.putIfAbsent(e.getKey(), value);
}
}
}

/**
* Send id repo with uin.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM nginx

ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME
LABEL source=${SOURCE}
LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

VOLUME /home/mosip

COPY nginx.conf /etc/nginx/nginx.conf
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM openjdk:11

ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME
LABEL source=${SOURCE}
LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

#Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image
#FROM openjdk:8-jdk-alpine

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM openjdk:11

ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME
LABEL source=${SOURCE}
LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

#Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image
#FROM openjdk:8-jdk-alpine

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM openjdk:11

ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME
LABEL source=${SOURCE}
LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

#Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image
#FROM openjdk:8-jdk-alpine

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM openjdk:11

ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME
LABEL source=${SOURCE}
LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

#Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image
#FROM openjdk:8-jdk-alpine

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
FROM openjdk:11

ARG SOURCE
ARG COMMIT_HASH
ARG COMMIT_ID
ARG BUILD_TIME
LABEL source=${SOURCE}
LABEL commit_hash=${COMMIT_HASH}
LABEL commit_id=${COMMIT_ID}
LABEL build_time=${BUILD_TIME}

#Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image
#FROM openjdk:8-jdk-alpine

Expand Down

0 comments on commit cfe71a5

Please sign in to comment.