Index: lams_central/web/includes/javascript/authoring/authoringGeneral.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/authoring/authoringGeneral.js,v diff -u -r1.51.2.25 -r1.51.2.26 --- lams_central/web/includes/javascript/authoring/authoringGeneral.js 11 Oct 2015 14:32:25 -0000 1.51.2.25 +++ lams_central/web/includes/javascript/authoring/authoringGeneral.js 31 Jan 2016 11:44:41 -0000 1.51.2.26 @@ -2702,6 +2702,7 @@ $.ajax({ type : 'POST', url : LAMS_URL + 'authoring/author.do', + async: false, data : { 'method' : 'saveLearningDesignImage', 'learningDesignID' : layout.ld.learningDesignID, Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/LearningDesignService.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/LearningDesignService.java,v diff -u -r1.32.2.4 -r1.32.2.5 --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/LearningDesignService.java 2 Sep 2015 11:36:06 -0000 1.32.2.4 +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/LearningDesignService.java 31 Jan 2016 11:44:39 -0000 1.32.2.5 @@ -30,7 +30,6 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.Date; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -97,7 +96,7 @@ /********************************************** * Setter/Getter Methods - * *******************************************/ + *******************************************/ /** * Set i18n MessageService */ @@ -142,7 +141,7 @@ /********************************************** * Service Methods - * *******************************************/ + *******************************************/ /** * Get the learning design DTO, suitable to send to Flash via WDDX @@ -232,8 +231,8 @@ ArrayList libraries = new ArrayList(); while (iterator.hasNext()) { LearningLibrary learningLibrary = iterator.next(); - List templateActivities = activityDAO.getActivitiesByLibraryID(learningLibrary - .getLearningLibraryId()); + List templateActivities = activityDAO + .getActivitiesByLibraryID(learningLibrary.getLearningLibraryId()); if ((templateActivities != null) & (templateActivities.size() == 0)) { log.error("Learning Library with ID " + learningLibrary.getLearningLibraryId() @@ -278,10 +277,10 @@ toolDTO.setToolId(libraryActivityDTO.getToolID()); } toolDTO.setLearningLibraryId(learningLibrary.getLearningLibraryID()); - toolDTO.setToolDisplayName(isParallel ? learningLibrary.getTitle() : libraryActivityDTO - .getActivityTitle()); - toolDTO.setActivityCategoryID(isParallel ? Activity.CATEGORY_SPLIT : libraryActivityDTO - .getActivityCategoryID()); + toolDTO.setToolDisplayName( + isParallel ? learningLibrary.getTitle() : libraryActivityDTO.getActivityTitle()); + toolDTO.setActivityCategoryID( + isParallel ? Activity.CATEGORY_SPLIT : libraryActivityDTO.getActivityCategoryID()); if (libraryActivityDTO.getToolID() == null) { String iconPath = libraryActivityDTO.getLibraryActivityUIImage(); @@ -377,7 +376,8 @@ // construct absolute filePath to SVG String earFolder = Configuration.get(ConfigurationKeys.LAMS_EAR_DIR); if (StringUtils.isBlank(earFolder)) { - log.error("Unable to get path to the LAMS Server URL from the configuration table. SVG image creation failed"); + log.error( + "Unable to get path to the LAMS Server URL from the configuration table. SVG image creation failed"); return null; } String directoryToStoreFile = FileUtil.getFullPath(earFolder, "lams-www.war\\secure\\learning-design-images"); @@ -391,7 +391,7 @@ String fileExtension; if (imageFormat == SVGGenerator.OUTPUT_FORMAT_SVG) { fileExtension = ".svg"; - } else if (imageFormat == SVGGenerator.OUTPUT_FORMAT_SVG_LAMS_COMMUNITY){ + } else if (imageFormat == SVGGenerator.OUTPUT_FORMAT_SVG_LAMS_COMMUNITY) { // mark it as a special version of SVG as it contains icons that refer to LAMS Community server fileExtension = ".export.svg"; } else { @@ -402,7 +402,8 @@ // check if SVG exists and up-to-date LearningDesign learningDesign = learningDesignDAO.getLearningDesignById(learningDesignId); - boolean isSvgOutdated = new Date(file.lastModified()).before(learningDesign.getLastModifiedDateTime()); + boolean isSvgOutdated = (((file.lastModified() / 1000) + 1) + - (learningDesign.getLastModifiedDateTime().getTime() / 1000)) < 0; if (!file.exists() || isSvgOutdated) { // generate new SVG image and save it to the file system SVGGenerator svgGenerator = new SVGGenerator();