Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java,v diff -u -r1.30 -r1.31 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java 31 Jan 2006 16:25:16 -0000 1.30 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/AuthoringUtil.java 2 Feb 2006 14:47:09 -0000 1.31 @@ -20,6 +20,7 @@ import org.apache.log4j.Logger; import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.contentrepository.FileException; import org.lamsfoundation.lams.contentrepository.NodeKey; import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; import org.lamsfoundation.lams.tool.exception.ToolException; @@ -1165,7 +1166,7 @@ String offlineInstructions=""; String onlineInstructions=""; String endLearningMessage=""; - String creationDate=""; + Date creationDate=null; int passmark=0; boolean isQuestionsSequenced=false; @@ -1234,10 +1235,11 @@ String richTextEndLearningMessage=(String)request.getSession().getAttribute(RICHTEXT_END_LEARNING_MSG); logger.debug("richTextEndLearningMessage: " + richTextEndLearningMessage); - creationDate=(String)request.getSession().getAttribute(CREATION_DATE); + creationDate=(Date)request.getSession().getAttribute(CREATION_DATE); if (creationDate == null) - creationDate=new Date(System.currentTimeMillis()).toString(); + creationDate=new Date(System.currentTimeMillis()); + logger.debug("using creationDate: " + creationDate); /*obtain user object from the session*/ HttpSession ss = SessionManager.getSession(); @@ -2285,9 +2287,18 @@ logger.debug("mimeType:" + mimeType); logger.debug("fileProperty:" + fileProperty); - NodeKey nodeKey=mcService.uploadFile(stream, fileName, mimeType, fileProperty); - logger.debug("nodeKey:" + nodeKey); - logger.debug("nodeKey uuid:" + nodeKey.getUuid()); + NodeKey nodeKey=null; + try{ + nodeKey=mcService.uploadFile(stream, fileName, mimeType, fileProperty); + logger.debug("nodeKey:" + nodeKey); + logger.debug("nodeKey uuid:" + nodeKey.getUuid()); + } + catch(FileException e) + { + logger.debug("exception writing raw data:" + e); + /* return a null dto*/ + return null; + } McAttachmentDTO mcAttachmentDTO= new McAttachmentDTO(); mcAttachmentDTO.setUid(null);