Skip to content

Commit

Permalink
DigiLocker Impl update the properties and add properties (#542)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahil-tarento authored Apr 29, 2024
1 parent 0e10b7d commit 36d95f0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/main/java/org/sunbird/digilocker/model/DocResponseDetails.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class DocResponseDetails {

private String docContent;
private String dataContent;
private String docDescription;

public DocResponseDetails() {
}
Expand All @@ -28,4 +29,13 @@ public void setDataContent(String dataContent) {
this.dataContent = dataContent;
}

@JacksonXmlProperty(localName = "DocDescription", namespace = "http://tempuri.org/")
public String getDocDescription() {
return docDescription;
}

public void setDocDescription(String docDescription) {
this.docDescription = docDescription;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class URIRequestDocDetails {
@JacksonXmlProperty(localName = "DocType")
private String DocType;

@JacksonXmlProperty(localName = "Mobile")
@JacksonXmlProperty(localName = "mobile_no")
private String Mobile;

@JacksonXmlProperty(localName = "FullName")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class URIResponseDocDetails {
private String URI;
private String docContent;
private String dataContent;
private String docDescription;

public URIResponseDocDetails() {
this.issuedTo = new IssuedTo();
Expand Down Expand Up @@ -48,5 +49,14 @@ public String getDataContent() {
public void setDataContent(String dataContent) {
this.dataContent = dataContent;
}

@JacksonXmlProperty(localName = "DocDescription", namespace = "http://tempuri.org/")
public String getDocDescription() {
return docDescription;
}

public void setDocDescription(String docDescription) {
this.docDescription = docDescription;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.springframework.web.client.RestTemplate;
import org.sunbird.cassandra.utils.CassandraOperation;
import org.sunbird.common.model.SBApiResponse;
import org.sunbird.common.service.ContentService;
import org.sunbird.common.service.OutboundRequestHandlerServiceImpl;
import org.sunbird.common.util.CbExtServerProperties;
import org.sunbird.common.util.Constants;
Expand Down Expand Up @@ -50,6 +51,9 @@ public class DigiLockerIntegrationServiceImpl implements DigiLockerIntegrationSe

@Autowired
ObjectMapper objectMapper;

@Autowired
ContentService contentService;
private Logger logger = LoggerFactory.getLogger(getClass().getName());
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("dd-MM-yyyy");
Expand Down Expand Up @@ -160,6 +164,10 @@ public PullURIResponse generateURIResponse(String digiLockerHmac, String request
docDetails.setDataContent(encodeBytesToBase64((convertObjectToJsonBytes(addCertificateInfo(certificateAddInfoDTO)))));
docDetails.setURI(serverProperties.getDigiLockerIssuerId() + "-" + request.getDocDetails().getDocType() + "-" + docId);
responseStatus.setStatus("1");
Map<String, Object> contentResponse = contentService.readContentFromCache((String)dockerLookUpInfo.get(Constants.COURSE_ID), Arrays.asList(Constants.NAME));
if (MapUtils.isNotEmpty(contentResponse)) {
docDetails.setDocDescription((String) contentResponse.get(Constants.NAME));
}
} else {
logger.error("Not able to generate Pdf certificate for URI: " + docDetails.getURI());
responseStatus.setStatus("0");
Expand Down Expand Up @@ -237,6 +245,10 @@ public PullDocResponse generateDocResponse(String digiLockerHmac, String request
certificateAddInfoDTO.setSwdIndicator(String.valueOf(((String)getUserInfo.get(Constants.CHANNEL)).charAt(0)));
docDetails.setDataContent(encodeBytesToBase64((convertObjectToJsonBytes(addCertificateInfo(certificateAddInfoDTO)))));
response.setDocDetails(docDetails);
Map<String, Object> contentResponse = contentService.readContentFromCache((String)digiLockerDocInfo.get(Constants.COURSE_ID), Arrays.asList(Constants.NAME));
if (MapUtils.isNotEmpty(contentResponse)) {
docDetails.setDocDescription((String) contentResponse.get(Constants.NAME));
}
responseStatus.setStatus("1");
} else {
logger.error("Error while getting the user Info request:" + request);
Expand Down

0 comments on commit 36d95f0

Please sign in to comment.