Skip to content

Commit

Permalink
4.8.11 dev v3 (#455)
Browse files Browse the repository at this point in the history
* KCM Report added (#451)

* Report changes (#454)
  • Loading branch information
Sahil-tarento authored Feb 19, 2024
1 parent 1819226 commit ba4c494
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
11 changes: 11 additions & 0 deletions src/main/java/org/sunbird/common/util/CbExtServerProperties.java
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,9 @@ public void setRedisDataPort(String redisDataPort) {
@Value("${digilocker-issuer-id}")
private String digiLockerIssuerId;

@Value("${report.property.file.allMdo}")
private String reportPropertyFileAllMdo;

public boolean qListFromCacheEnabled() {
return qListFromCacheEnabled;
}
Expand Down Expand Up @@ -2316,4 +2319,12 @@ public String getDigiLockerIssuerId() {
public void setDigiLockerIssuerId(String digiLockerIssuerId) {
this.digiLockerIssuerId = digiLockerIssuerId;
}

public List<String> getReportPropertyFileAllMdo() {
return Arrays.asList(reportPropertyFileAllMdo.split(",", -1));
}

public void setReportPropertyFileAllMdo(String reportPropertyFileAllMdo) {
this.reportPropertyFileAllMdo = reportPropertyFileAllMdo;
}
}
17 changes: 15 additions & 2 deletions src/main/java/org/sunbird/storage/service/StorageServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,14 @@ public ResponseEntity<Resource> downloadFile(String reportType, String date, Str
logger.error("User is not authorized to download the file for other org: " + rootOrgId + ", request orgId " + orgId);
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();
}
String objectKey = serverProperties.getReportDownloadFolderName() + "/" + reportType + "/" + date + "/" + orgId + "/" + fileName;
String objectKey = "";
if (serverProperties.getReportPropertyFileAllMdo().contains(fileName)) {
String reportSubFolderName = fileName.replace(".csv", "");
objectKey = serverProperties.getReportDownloadFolderName() + "/" + reportType + "/" + date + "/" + reportSubFolderName + "/" + fileName;
} else {
objectKey = serverProperties.getReportDownloadFolderName() + "/" + reportType + "/" + date + "/" + orgId + "/" + fileName;
}

storageService.download(serverProperties.getReportDownloadContainerName(), objectKey, Constants.LOCAL_BASE_PATH,
Option.apply(Boolean.FALSE));
Path tmpPath = Paths.get(Constants.LOCAL_BASE_PATH + fileName);
Expand Down Expand Up @@ -235,7 +242,13 @@ public ResponseEntity<Map<String, Map<String, Object>>> getFileInfo(String orgId
}
}*/
String fileName = reportFileNameMap.get(reportType);
String objectKey = serverProperties.getReportDownloadFolderName() + "/" + reportType + "/" + todayFormattedDate + "/" + mdoId + "/" + fileName;
String objectKey = "";
if (serverProperties.getReportPropertyFileAllMdo().contains(fileName)) {
String reportSubFolderName = fileName.replace(".csv", "");
objectKey = serverProperties.getReportDownloadFolderName() + "/" + reportType + "/" + todayFormattedDate + "/" + reportSubFolderName + "/" + fileName;
} else {
objectKey = serverProperties.getReportDownloadFolderName() + "/" + reportType + "/" + todayFormattedDate + "/" + mdoId + "/" + fileName;
}
try {
Model.Blob blob = storageService.getObject(serverProperties.getReportDownloadContainerName(), objectKey, Option.apply(Boolean.FALSE));
if (blob != null) {
Expand Down
5 changes: 3 additions & 2 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ user.registration.welcome.email.signinLink=https://karmayogibm.nic.in/protected/
user.registration.welcome.email.discoverLink=https://karmayogibm.nic.in/page/learn
user.registration.welcome.email.profileUpdateLink=https://portal.karmayogibm.nic.in/app/user-profile/details
user.registration.welcome.email.meetingLink=https://teams.microsoft.com/l/meetup-join/19%3ameeting_M2Y3ZDE2ZDMtMWQwYS00OWQzLWE3NDctNDRkNTdjOGI4Yzll%40thread.v2/0?context=%7b%22Tid%22%3a%2240cfb65c-9b71-435f-8bc2-bc2c69df1aca%22%2c%22Oid%22%3a%22cbd37bc9-5c33-401f-b590-9decb3c370f8%22%7d
report.type.get.file.info=user-report,course-report,user-assessment-report-cbp,user-enrollment-report,cba-report,blended-program-report-mdo,blended-program-report-cbp,cbp-report-mdo-summary,cbp-report-mdo-enrolment
report.type.get.file.info=user-report,course-report,user-assessment-report-cbp,user-enrollment-report,cba-report,blended-program-report-mdo,blended-program-report-cbp,cbp-report-mdo-summary,cbp-report-mdo-enrolment,kcm-report
redis.questions.read.timeout=3600
read.assess.questions.from.redis=true

Expand Down Expand Up @@ -367,7 +367,7 @@ kafka.topic.cbplan.content.request.group=cbplanContentRequestAsyncHandlerGroup
cbplan.content.request.notification.template=cbplanContentRequestTemplate

spv.report.property.map={"mdo_content_completion":"AllMDOsContentCompletion.csv","user_recent_completions":"Top1LakhUsersContentCompletionLast15Days.csv","user_without_enrollment":"UsersOnboardedNotSignedUpAnyContent.csv","recent_user_without_enrollment":"UsersOnboardedLast15DaysNotSignedUpAnyContent.csv","all_prarambh_completed_users":"UsersFinishedEntirePrarambhModule.csv","prarambh_completed_users":"UsersCompleted6PrarambhCoursesPendingFullCompletion.csv","cbp_user_summary_exhaust":"CBPUserSummaryReport.csv","cbp_enrollment_exhaust":"CBPEnrollmentReport.csv"}
report.property.map={"user-report":"UserReport.csv","user-enrollment-report":"ConsumptionReport.csv","course-report":"CBPReport.csv","cba-report":"UserAssessmentReport.csv","user-assessment-report-cbp":"StandaloneAssessmentReport.csv","blended-program-report-mdo":"BlendedProgramReport.csv","blended-program-report-cbp":"BlendedProgramReport.csv","cbp-report-mdo-summary":"CBPUserSummaryReport.csv","cbp-report-mdo-enrolment":"CBPEnrollmentReport.csv"}
report.property.map={"user-report":"UserReport.csv","user-enrollment-report":"ConsumptionReport.csv","course-report":"ContentReport.csv","cba-report":"UserAssessmentReport.csv","user-assessment-report-cbp":"StandaloneAssessmentReport.csv","blended-program-report-mdo":"BlendedProgramReport.csv","blended-program-report-cbp":"BlendedProgramReport.csv","cbp-report-mdo-summary":"CBPUserSummaryReport.csv","cbp-report-mdo-enrolment":"CBPEnrollmentReport.csv","kcm-report":"ContentCompetencyMapping.csv"}
spv.report.property.subFolder.map={"AllMDOsContentCompletion.csv":"comms-console","Top1LakhUsersContentCompletionLast15Days.csv":"comms-console","UsersOnboardedNotSignedUpAnyContent.csv":"comms-console","UsersOnboardedLast15DaysNotSignedUpAnyContent.csv":"comms-console","UsersFinishedEntirePrarambhModule.csv":"comms-console","UsersCompleted6PrarambhCoursesPendingFullCompletion.csv":"comms-console","CBPUserSummaryReport.csv":"cbp-report","CBPEnrollmentReport.csv":"cbp-report"}
recommend.content.notification.template=recommend_content_email

Expand All @@ -382,3 +382,4 @@ cert-registry-service-host=http://cert-registry-service:9000
cert-registry-certificate-download-url=/certs/v2/registry/download/

digilocker-issuer-id=karmayogibharat.gov.in
report.property.file.allMdo=ContentCompetencyMapping.csv

0 comments on commit ba4c494

Please sign in to comment.