Merge pull request #4232 from ritzalam/more-logging-during-conversion
More logging during conversion
This commit is contained in:
commit
b1b6c83235
@ -48,7 +48,7 @@ class PresentationModel {
|
||||
}
|
||||
|
||||
def setCurrentPresentation(presId: String): Option[Presentation] = {
|
||||
getCurrentPresentation foreach (curPres => {
|
||||
getPresentations foreach (curPres => {
|
||||
if (curPres.id != presId) {
|
||||
val newPres = curPres.copy(current = false)
|
||||
savePresentation(newPres)
|
||||
|
@ -71,6 +71,11 @@ class AnalyticsActor extends Actor with ActorLogging {
|
||||
// Breakout
|
||||
case m: BreakoutRoomEndedEvtMsg => logMessage(msg)
|
||||
|
||||
// Presentation
|
||||
case m: PresentationConversionCompletedSysPubMsg => logMessage(msg)
|
||||
case m: SetCurrentPresentationPubMsg => logMessage(msg)
|
||||
case m: SetCurrentPresentationEvtMsg => logMessage(msg)
|
||||
|
||||
case _ => // ignore message
|
||||
}
|
||||
}
|
||||
|
@ -77,6 +77,7 @@ class FromAkkaAppsMsgSenderActor(msgSender: MessageSender)
|
||||
case RemovePresentationEvtMsg.NAME =>
|
||||
msgSender.send(fromAkkaAppsPresRedisChannel, json)
|
||||
case SetCurrentPresentationEvtMsg.NAME =>
|
||||
msgSender.send(fromAkkaAppsPresRedisChannel, json)
|
||||
|
||||
// Breakout
|
||||
case UpdateBreakoutUsersEvtMsg.NAME =>
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
package org.bigbluebutton.presentation;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.bigbluebutton.api.messaging.MessagingService;
|
||||
import org.bigbluebutton.api2.IBbbWebApiGWApp;
|
||||
import org.bigbluebutton.presentation.imp.ImageToSwfSlidesGenerationService;
|
||||
@ -27,6 +28,9 @@ import org.bigbluebutton.presentation.imp.PdfToSwfSlidesGenerationService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DocumentConversionServiceImp implements DocumentConversionService {
|
||||
private static Logger log = LoggerFactory
|
||||
.getLogger(DocumentConversionServiceImp.class);
|
||||
@ -38,8 +42,17 @@ public class DocumentConversionServiceImp implements DocumentConversionService {
|
||||
|
||||
public void processDocument(UploadedPresentation pres) {
|
||||
SupportedDocumentFilter sdf = new SupportedDocumentFilter(gw);
|
||||
log.info("Start presentation conversion. meetingId=" + pres.getMeetingId()
|
||||
+ " presId=" + pres.getId() + " name=" + pres.getName() + " current=" + pres.isCurrent());
|
||||
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("current", pres.isCurrent());
|
||||
logData.put("message", "Start presentation conversion.");
|
||||
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.info("-- analytics -- " + logStr);
|
||||
|
||||
if (sdf.isSupported(pres)) {
|
||||
String fileType = pres.getFileType();
|
||||
@ -65,9 +78,15 @@ public class DocumentConversionServiceImp implements DocumentConversionService {
|
||||
// TODO: error log
|
||||
}
|
||||
|
||||
log.info("End presentation conversion. meetingId=" + pres.getMeetingId()
|
||||
+ " presId=" + pres.getId() + " name=" + pres.getName());
|
||||
|
||||
logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("current", pres.isCurrent());
|
||||
logData.put("message", "End presentation conversion.");
|
||||
gson = new Gson();
|
||||
logStr = gson.toJson(logData);
|
||||
log.info("-- analytics -- " + logStr);
|
||||
}
|
||||
|
||||
public void setBbbWebApiGWApp(IBbbWebApiGWApp m) {
|
||||
|
@ -20,7 +20,10 @@
|
||||
package org.bigbluebutton.presentation.imp;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.bigbluebutton.presentation.PageConverter;
|
||||
import org.bigbluebutton.presentation.UploadedPresentation;
|
||||
import org.slf4j.Logger;
|
||||
@ -40,7 +43,15 @@ public class Jpeg2SwfPageConverter implements PageConverter {
|
||||
if (done && output.exists()) {
|
||||
return true;
|
||||
} else {
|
||||
log.warn("Failed to convert: " + output.getAbsolutePath() + " does not exist.");
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Failed to convert: " + output.getAbsolutePath() + " does not exist.");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.bigbluebutton.presentation.PageConverter;
|
||||
import org.bigbluebutton.presentation.UploadedPresentation;
|
||||
import org.slf4j.Logger;
|
||||
@ -40,8 +41,14 @@ public class Office2PdfPageConverter implements PageConverter {
|
||||
|
||||
try {
|
||||
connection.connect();
|
||||
|
||||
log.debug("Converting " + presentationFile.getAbsolutePath() + " to " + output.getAbsolutePath());
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Converting Office doc to PDF.");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.info("-- analytics -- " + logStr);
|
||||
|
||||
DefaultDocumentFormatRegistry registry = new DefaultDocumentFormatRegistry();
|
||||
OpenOfficeDocumentConverter converter = new OpenOfficeDocumentConverter(connection, registry);
|
||||
@ -58,12 +65,28 @@ public class Office2PdfPageConverter implements PageConverter {
|
||||
if (output.exists()) {
|
||||
return true;
|
||||
} else {
|
||||
log.warn("Failed to convert: " + output.getAbsolutePath() + " does not exist.");
|
||||
logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Failed to convert Office doc to PDF.");
|
||||
gson = new Gson();
|
||||
logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
log.error("Exception: Failed to convert " + output.getAbsolutePath());
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Failed to convert Office doc to PDF.");
|
||||
logData.put("exception", e.getMessage());
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.error("-- analytics -- " + logStr);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,10 @@ package org.bigbluebutton.presentation.imp;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.collections4.Predicate;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
@ -27,12 +30,20 @@ public class OfficeDocumentValidator {
|
||||
try {
|
||||
xmlSlideShow = new XMLSlideShow(
|
||||
new FileInputStream(pres.getUploadedFile()));
|
||||
valid &= !embedsEmf(xmlSlideShow);
|
||||
valid &= !containsTinyTileBackground(xmlSlideShow);
|
||||
valid &= !embedsEmf(xmlSlideShow, pres);
|
||||
valid &= !containsTinyTileBackground(xmlSlideShow, pres);
|
||||
// Close the resource once we finished reading it
|
||||
xmlSlideShow.close();
|
||||
} catch (IOException e) {
|
||||
log.error("Cannot open PPTX file " + pres.getName());
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Cannot open PPTX file " + pres.getName());
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.error("-- analytics -- " + logStr);
|
||||
|
||||
valid = false;
|
||||
}
|
||||
}
|
||||
@ -45,13 +56,21 @@ public class OfficeDocumentValidator {
|
||||
* @param xmlSlideShow
|
||||
* @return
|
||||
*/
|
||||
private boolean embedsEmf(XMLSlideShow xmlSlideShow) {
|
||||
private boolean embedsEmf(XMLSlideShow xmlSlideShow, UploadedPresentation pres) {
|
||||
EmfPredicate emfPredicate = new EmfPredicate();
|
||||
ArrayList<XSLFPictureData> embeddedEmfFiles = (ArrayList<XSLFPictureData>) CollectionUtils
|
||||
.select(xmlSlideShow.getPictureData(), emfPredicate);
|
||||
if (embeddedEmfFiles.size() > 0) {
|
||||
log.warn(
|
||||
"Found " + embeddedEmfFiles.size() + " EMF files in presentation.");
|
||||
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Found " + embeddedEmfFiles.size() + " EMF files in presentation.");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -63,12 +82,21 @@ public class OfficeDocumentValidator {
|
||||
* @param xmlSlideShow
|
||||
* @return
|
||||
*/
|
||||
private boolean containsTinyTileBackground(XMLSlideShow xmlSlideShow) {
|
||||
private boolean containsTinyTileBackground(XMLSlideShow xmlSlideShow, UploadedPresentation pres) {
|
||||
TinyTileBackgroundPredicate tinyTileCondition = new TinyTileBackgroundPredicate();
|
||||
ArrayList<XSLFPictureData> tileImage = (ArrayList<XSLFPictureData>) CollectionUtils
|
||||
.select(xmlSlideShow.getPictureData(), tinyTileCondition);
|
||||
if (tileImage.size() > 0) {
|
||||
log.warn("Found small background tile image.");
|
||||
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Found small background tile image.");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -20,7 +20,10 @@
|
||||
package org.bigbluebutton.presentation.imp;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.bigbluebutton.presentation.ConversionMessageConstants;
|
||||
import org.bigbluebutton.presentation.PageConverter;
|
||||
import org.bigbluebutton.presentation.SupportedFileTypes;
|
||||
@ -43,26 +46,46 @@ public class OfficeToPdfConversionService {
|
||||
if (SupportedFileTypes.isOfficeFile(pres.getFileType())) {
|
||||
boolean valid = officeDocumentValidator.isValid(pres);
|
||||
if (!valid) {
|
||||
log.warn("Problems detected prior to converting the file to PDF.");
|
||||
pres.setConversionStatus(
|
||||
ConversionMessageConstants.OFFICE_DOC_CONVERSION_INVALID_KEY);
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Problems detected prior to converting the file to PDF.");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
pres.setConversionStatus(ConversionMessageConstants.OFFICE_DOC_CONVERSION_INVALID_KEY);
|
||||
return pres;
|
||||
}
|
||||
File pdfOutput = setupOutputPdfFile(pres);
|
||||
if (convertOfficeDocToPdf(pres, pdfOutput)) {
|
||||
log.info("Successfully converted office file to pdf.");
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Successfully converted office file to pdf.");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.info("-- analytics -- " + logStr);
|
||||
|
||||
makePdfTheUploadedFileAndSetStepAsSuccess(pres, pdfOutput);
|
||||
} else {
|
||||
log.warn("Failed to convert " + pres.getUploadedFile().getAbsolutePath()
|
||||
+ " to Pdf.");
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Failed to convert " + pres.getUploadedFile().getAbsolutePath() + " to Pdf.");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
}
|
||||
}
|
||||
return pres;
|
||||
}
|
||||
|
||||
public void initialize(UploadedPresentation pres) {
|
||||
pres.setConversionStatus(
|
||||
ConversionMessageConstants.OFFICE_DOC_CONVERSION_FAILED_KEY);
|
||||
pres.setConversionStatus(ConversionMessageConstants.OFFICE_DOC_CONVERSION_FAILED_KEY);
|
||||
}
|
||||
|
||||
private File setupOutputPdfFile(UploadedPresentation pres) {
|
||||
@ -78,11 +101,9 @@ public class OfficeToPdfConversionService {
|
||||
return converter.convert(pres.getUploadedFile(), pdfOutput, 0, pres);
|
||||
}
|
||||
|
||||
private void makePdfTheUploadedFileAndSetStepAsSuccess(
|
||||
UploadedPresentation pres, File pdf) {
|
||||
private void makePdfTheUploadedFileAndSetStepAsSuccess(UploadedPresentation pres, File pdf) {
|
||||
pres.setUploadedFile(pdf);
|
||||
pres.setConversionStatus(
|
||||
ConversionMessageConstants.OFFICE_DOC_CONVERSION_SUCCESS_KEY);
|
||||
pres.setConversionStatus(ConversionMessageConstants.OFFICE_DOC_CONVERSION_SUCCESS_KEY);
|
||||
}
|
||||
|
||||
public void setOfficeDocumentValidator(OfficeDocumentValidator v) {
|
||||
|
@ -33,9 +33,6 @@ public class PageExtractorImp implements PageExtractor {
|
||||
public boolean extractPage(File presentationFile, File output, int page) {
|
||||
String COMMAND = "pdfseparate -f " + page + " -l " + page + SPACE
|
||||
+ presentationFile.getAbsolutePath() + SPACE + output.getAbsolutePath();
|
||||
|
||||
log.info("Extracting page {} for document {}", page,
|
||||
presentationFile.getAbsolutePath());
|
||||
return new ExternalProcessExecutor().exec(COMMAND, 60000);
|
||||
}
|
||||
}
|
||||
|
@ -115,19 +115,26 @@ public class Pdf2SwfPageConverter implements PageConverter {
|
||||
logData.put("numObjectTags", pHandler.numberOfPlacements());
|
||||
logData.put("numTextTags", pHandler.numberOfTextTags());
|
||||
logData.put("numImageTags", pHandler.numberOfImageTags());
|
||||
logData.put("message", "Potential problem with generated SWF");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
|
||||
log.warn("Potential problem with generated SWF: data={}", logStr);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
File tempPng = null;
|
||||
String basePresentationame = FilenameUtils
|
||||
.getBaseName(presentation.getName());
|
||||
String basePresentationame = FilenameUtils.getBaseName(presentation.getName());
|
||||
try {
|
||||
tempPng = File.createTempFile(basePresentationame + "-" + page, ".png");
|
||||
} catch (IOException ioException) {
|
||||
// We should never fall into this if the server is correctly configured
|
||||
log.error("Unable to create temporary files");
|
||||
logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Unable to create temporary files");
|
||||
gson = new Gson();
|
||||
logStr = gson.toJson(logData);
|
||||
log.error("-- analytics -- " + logStr);
|
||||
}
|
||||
|
||||
long pdfStart = System.currentTimeMillis();
|
||||
@ -149,9 +156,8 @@ public class Pdf2SwfPageConverter implements PageConverter {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
|
||||
long pdfEnd = System.currentTimeMillis();
|
||||
log.debug("pdftocairo conversion duration: {} sec",
|
||||
(pdfEnd - pdfStart) / 1000);
|
||||
//long pdfEnd = System.currentTimeMillis();
|
||||
//log.debug("pdftocairo conversion duration: {} sec", (pdfEnd - pdfStart) / 1000);
|
||||
|
||||
long png2swfStart = System.currentTimeMillis();
|
||||
|
||||
@ -170,9 +176,8 @@ public class Pdf2SwfPageConverter implements PageConverter {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
|
||||
long png2swfEnd = System.currentTimeMillis();
|
||||
log.debug("SwfTools conversion duration: {} sec",
|
||||
(png2swfEnd - png2swfStart) / 1000);
|
||||
//long png2swfEnd = System.currentTimeMillis();
|
||||
//log.debug("SwfTools conversion duration: {} sec", (png2swfEnd - png2swfStart) / 1000);
|
||||
|
||||
// Delete the temporary PNG and PDF files after finishing the image
|
||||
// conversion
|
||||
@ -188,16 +193,23 @@ public class Pdf2SwfPageConverter implements PageConverter {
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("page", page);
|
||||
logData.put("conversionTime(sec)", (convertEnd - convertStart) / 1000);
|
||||
|
||||
logData.put("message", "Problem page conversion overall duration.");
|
||||
logStr = gson.toJson(logData);
|
||||
|
||||
log.debug("Problem page conversion overall duration: {} sec",
|
||||
(convertEnd - convertStart) / 1000);
|
||||
log.info("-- analytics -- " + logStr);
|
||||
|
||||
if (doneSwf && destFile.exists()) {
|
||||
return true;
|
||||
} else {
|
||||
log.warn("Failed to convert: " + destFile + " does not exist.");
|
||||
logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("page", page);
|
||||
logData.put("conversionTime(sec)", (convertEnd - convertStart) / 1000);
|
||||
logData.put("message", "Failed to convert: " + destFile + " does not exist.");
|
||||
logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -101,6 +101,15 @@ public class PdfToSwfSlidesGenerationService {
|
||||
if (e.getExceptionType() == CountingPageException.ExceptionType.PAGE_COUNT_EXCEPTION) {
|
||||
builder.messageKey(ConversionMessageConstants.PAGE_COUNT_FAILED_KEY);
|
||||
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Failed to determine number of pages.");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
DocPageCountFailed progress = new DocPageCountFailed(pres.getMeetingId(),
|
||||
pres.getId(), pres.getId(),
|
||||
pres.getName(), "notUsedYet", "notUsedYet",
|
||||
@ -113,6 +122,17 @@ public class PdfToSwfSlidesGenerationService {
|
||||
builder.maxNumberPages(e.getMaxNumberOfPages());
|
||||
builder.messageKey(ConversionMessageConstants.PAGE_COUNT_EXCEEDED_KEY);
|
||||
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("pageCount", e.getPageCount());
|
||||
logData.put("maxNumPages", e.getMaxNumberOfPages());
|
||||
logData.put("message", "Number of pages exceeeded.");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
DocPageCountExceeded progress = new DocPageCountExceeded(pres.getMeetingId(),
|
||||
pres.getId(), pres.getId(),
|
||||
pres.getName(), "notUsedYet", "notUsedYet",
|
||||
@ -180,11 +200,11 @@ public class PdfToSwfSlidesGenerationService {
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("page", slide.getPageNumber());
|
||||
|
||||
logData.put("message", "ExecutionException while converting page.");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
log.warn("ExecutionException while converting page: data={}", logStr);
|
||||
log.error(e.getMessage());
|
||||
} catch (InterruptedException e) {
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
@ -192,11 +212,11 @@ public class PdfToSwfSlidesGenerationService {
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("page", slide.getPageNumber());
|
||||
|
||||
logData.put("message", "InterruptedException while converting page");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
log.warn("InterruptedException while converting page: data={}", logStr);
|
||||
Thread.currentThread().interrupt();
|
||||
} catch (TimeoutException e) {
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
@ -204,11 +224,11 @@ public class PdfToSwfSlidesGenerationService {
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("page", slide.getPageNumber());
|
||||
|
||||
logData.put("message", "TimeoutException while converting page");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
log.warn("TimeoutException while converting page: data={}", logStr);
|
||||
f.cancel(true);
|
||||
}
|
||||
|
||||
@ -219,10 +239,10 @@ public class PdfToSwfSlidesGenerationService {
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("page", slide.getPageNumber());
|
||||
logData.put("conversionTime(sec)", (pageConvEnd - pageConvStart) / 1000);
|
||||
logData.put("message", "Page conversion duration(sec)");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
|
||||
log.debug("Page conversion duration(sec): data={}", logStr);
|
||||
log.info("-- analytics -- " + logStr);
|
||||
|
||||
}
|
||||
|
||||
@ -235,11 +255,11 @@ public class PdfToSwfSlidesGenerationService {
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
|
||||
logData.put("page", slide.getPageNumber());
|
||||
logData.put("message", "Creating blank slide");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
|
||||
log.warn("Creating blank slide: data={}", logStr);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
notifier.sendConversionUpdateMessage(slidesCompleted++, pres);
|
||||
}
|
||||
@ -251,10 +271,11 @@ public class PdfToSwfSlidesGenerationService {
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("conversionTime(sec)", (presConvEnd - presConvStart) / 1000);
|
||||
logData.put("message", "Presentation conversion duration (sec)");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.info("-- analytics -- " + logStr);
|
||||
|
||||
log.debug("Presentation conversion duration (sec): data={}", logStr);
|
||||
}
|
||||
|
||||
private List<PdfToSwfSlide> setupSlides(UploadedPresentation pres,
|
||||
|
@ -20,7 +20,10 @@
|
||||
package org.bigbluebutton.presentation.imp;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.bigbluebutton.presentation.PageConverter;
|
||||
import org.bigbluebutton.presentation.UploadedPresentation;
|
||||
import org.slf4j.Logger;
|
||||
@ -39,7 +42,15 @@ public class Png2SwfPageConverter implements PageConverter {
|
||||
if (done && output.exists()) {
|
||||
return true;
|
||||
} else {
|
||||
log.warn("Failed to convert: " + output.getAbsolutePath() + " does not exist.");
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Failed to convert PNG doc to SWF.");
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
package org.bigbluebutton.presentation.imp;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.bigbluebutton.presentation.SupportedFileTypes;
|
||||
import org.bigbluebutton.presentation.SvgImageCreator;
|
||||
import org.bigbluebutton.presentation.UploadedPresentation;
|
||||
@ -74,7 +77,17 @@ public class SvgImageCreatorImp implements SvgImageCreator {
|
||||
if (done) {
|
||||
return true;
|
||||
}
|
||||
log.warn("Failed to create svg images: " + COMMAND);
|
||||
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Failed to create svg images.");
|
||||
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,10 @@ import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.bigbluebutton.presentation.SupportedFileTypes;
|
||||
import org.bigbluebutton.presentation.TextFileCreator;
|
||||
import org.bigbluebutton.presentation.UploadedPresentation;
|
||||
@ -94,7 +97,17 @@ public class TextFileCreatorImp implements TextFileCreator {
|
||||
boolean done = new ExternalProcessExecutor().exec(COMMAND, 60000);
|
||||
if (!done) {
|
||||
success = false;
|
||||
log.warn("Failed to create textfiles: " + COMMAND);
|
||||
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Failed to create text files.");
|
||||
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -21,9 +21,12 @@ package org.bigbluebutton.presentation.imp;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.bigbluebutton.presentation.SupportedFileTypes;
|
||||
import org.bigbluebutton.presentation.ThumbnailCreator;
|
||||
@ -85,7 +88,15 @@ public class ThumbnailCreatorImp implements ThumbnailCreator {
|
||||
if (done) {
|
||||
return true;
|
||||
} else {
|
||||
log.warn("Failed to create thumbnails: " + COMMAND);
|
||||
Map<String, Object> logData = new HashMap<String, Object>();
|
||||
logData.put("meetingId", pres.getMeetingId());
|
||||
logData.put("presId", pres.getId());
|
||||
logData.put("filename", pres.getName());
|
||||
logData.put("message", "Failed to create thumbnails.");
|
||||
|
||||
Gson gson = new Gson();
|
||||
String logStr = gson.toJson(logData);
|
||||
log.warn("-- analytics -- " + logStr);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user