Skip to content
Snippets Groups Projects
Commit 45f8def0 authored by Richard Alam's avatar Richard Alam
Browse files

- send message when office to pdf conversion failed

parent fafc79b6
No related branches found
No related tags found
No related merge requests found
......@@ -63,10 +63,16 @@ public class DocumentConversionServiceImp implements DocumentConversionService {
pres = officeToPdfConversionService.convertOfficeToPdf(pres);
OfficeToPdfConversionSuccessFilter ocsf = new OfficeToPdfConversionSuccessFilter(gw);
if (ocsf.didConversionSucceed(pres)) {
ocsf.sendProgress(pres);
// Successfully converted to pdf. Call the process again, this time it
// should be handled by
// the PDF conversion service.
processDocument(pres);
} else {
// Send notification that office to pdf conversion failed.
// The cause should have been set by the previous step.
// (ralam feb 15, 2020)
ocsf.sendProgress(pres);
}
} else if (SupportedFileTypes.isPdfFile(fileType)) {
pdfToSwfSlidesGenerationService.generateSlides(pres);
......
......@@ -48,32 +48,19 @@ public class OfficeToPdfConversionSuccessFilter {
}
public boolean didConversionSucceed(UploadedPresentation pres) {
notifyProgressListener(pres);
return ConversionMessageConstants.OFFICE_DOC_CONVERSION_SUCCESS_KEY.equals(pres.getConversionStatus());
}
private void notifyProgressListener(UploadedPresentation pres) {
Map<String, Object> msg = new HashMap<String, Object>();
msg.put("conference", pres.getMeetingId());
msg.put("room", pres.getMeetingId());
msg.put("returnCode", "CONVERT");
msg.put("presentationId", pres.getId());
msg.put("podId", pres.getPodId());
msg.put("presentationName", pres.getId());
msg.put("filename", pres.getName());
msg.put("message", conversionMessagesMap.get(pres.getConversionStatus()));
msg.put("messageKey", pres.getConversionStatus());
log.info("Notifying of {} for {}", pres.getConversionStatus(), pres.getUploadedFile().getAbsolutePath());
sendProgress(pres);
}
public void sendProgress(UploadedPresentation pres) {
OfficeDocConversionProgress progress = new OfficeDocConversionProgress(pres.getPodId(),
pres.getMeetingId(),pres.getId(), pres.getId(),
pres.getName(), "notUsedYet", "notUsedYet",
pres.isDownloadable(), pres.getConversionStatus());
pres.getMeetingId(),
pres.getId(),
pres.getId(),
pres.getName(),
"notUsedYet",
"notUsedYet",
pres.isDownloadable(),
pres.getConversionStatus());
gw.sendDocConversionMsg(progress);
}
......
......@@ -95,6 +95,8 @@ public class OfficeToPdfConversionService {
Gson gson = new Gson();
String logStr = gson.toJson(logData);
log.warn(" --analytics-- data={}", logStr);
pres.setConversionStatus(ConversionMessageConstants.OFFICE_DOC_CONVERSION_FAILED_KEY);
return pres;
}
}
return pres;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment