Index: lams_common/conf/language/ApplicationResources.properties =================================================================== diff -u -r57d7b431dc65cf7ee4f498cb0352a8ee821b8aa0 -r854d3d90fea3ac43dd486d51d339d0dad5adbf9e --- lams_common/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 57d7b431dc65cf7ee4f498cb0352a8ee821b8aa0) +++ lams_common/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 854d3d90fea3ac43dd486d51d339d0dad5adbf9e) @@ -34,4 +34,4 @@ #======= End labels: Exported 25 labels for en AU ===== error.import.matching.tool.not.found=The activity with signature {0} is skipped because a matching tool cannot be found. -error.import.matching.service.not.found=The activity with signature {0} is skipped because relating service bean is not available. +error.import.tool.service.fail=Unable to import tool content for tool {0}. Cause by {1}. Index: lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java =================================================================== diff -u -r57d7b431dc65cf7ee4f498cb0352a8ee821b8aa0 -r854d3d90fea3ac43dd486d51d339d0dad5adbf9e --- lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java (.../ExportToolContentService.java) (revision 57d7b431dc65cf7ee4f498cb0352a8ee821b8aa0) +++ lams_common/src/java/org/lamsfoundation/lams/learningdesign/service/ExportToolContentService.java (.../ExportToolContentService.java) (revision 854d3d90fea3ac43dd486d51d339d0dad5adbf9e) @@ -138,7 +138,7 @@ public static final String TOOL_FAILED_FILE_NAME = "export_failed.xml"; private static final String ERROR_TOOL_NOT_FOUND = "error.import.matching.tool.not.found"; - private static final String ERROR_SERVICE_NOT_FOUND = "error.import.matching.service.not.found"; + private static final String ERROR_SERVICE_ERROR = "error.import.tool.service.fail"; private Logger log = Logger.getLogger(ExportToolContentService.class); @@ -511,7 +511,7 @@ //can not find a matching tool if(newTool == null){ log.warn("An activity can not found matching tool [" + activity.getToolSignature()+"]."); - toolsErrorMsgs.add(getMessageService().getMessage(ERROR_TOOL_NOT_FOUND,activity.getToolSignature())); + toolsErrorMsgs.add(getMessageService().getMessage(ERROR_TOOL_NOT_FOUND,new Object[]{activity.getToolSignature()})); //remove this activity from LD removedActMap.put(activity.getActivityID(), activity); @@ -526,20 +526,15 @@ //Invoke tool's importToolContent() method. try{ ToolContentManager contentManager = (ToolContentManager) findToolService(newTool); - if(contentManager == null){ - toolsErrorMsgs.add(getMessageService().getMessage(ERROR_SERVICE_NOT_FOUND,activity.getToolSignature())); - //remove this activity from LD - removedActMap.put(activity.getActivityID(), activity); - continue; - } log.debug("Tool begin to import content : " + activity.getActivityTitle() +" by contentID :" + activity.getToolContentID()); contentManager.importToolContent(newContent.getToolContentId(),importer.getUserId(),toolPath); log.debug("Tool content import success."); }catch (Exception e) { - String error = "Unable to import tool content for tool "+newTool.getToolDisplayName() +". Cause by " - + e.toString(); + String error = getMessageService().getMessage(ERROR_SERVICE_ERROR,new Object[]{newTool.getToolDisplayName(),e.toString()}); log.error(error); toolsErrorMsgs.add(error); + //remove any unsucessed activities from new Learning design. + removedActMap.put(activity.getActivityID(), activity); } } //end all activities import @@ -761,7 +756,7 @@ return applicationContext.getBean(tool.getServiceName()); } - private Long saveLearningDesign(LearningDesignDTO dto, User importer, WorkspaceFolder folder, + public Long saveLearningDesign(LearningDesignDTO dto, User importer, WorkspaceFolder folder, Map toolMapper, Map removedActMap) throws ImportToolContentException {