Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/persistence/Forum.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/persistence/Forum.java,v diff -u -r1.28 -r1.29 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/persistence/Forum.java 17 Sep 2006 06:22:30 -0000 1.28 +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/persistence/Forum.java 11 Oct 2006 02:54:32 -0000 1.29 @@ -116,23 +116,14 @@ while(iter.hasNext()){ Attachment file = (Attachment)iter.next(); Attachment newFile = (Attachment) file.clone(); - //if toolContentHandle is null, just clone old file without duplicate it in repository - if(toolContentHandler != null){ - //duplicate file node in repository - NodeKey keys = toolContentHandler.copyFile(file.getFileUuid()); - newFile.setFileUuid(keys.getUuid()); - newFile.setFileVersionId(keys.getVersion()); - } + //clone old file without duplicate it in repository + set.add(newFile); } forum.attachments = set; } } catch (CloneNotSupportedException e) { log.error("When clone " + Forum.class + " failed"); - } catch (ItemNotFoundException e) { - log.error("When clone " + Forum.class + " failed"); - } catch (RepositoryCheckedException e) { - log.error("When clone " + Forum.class + " failed"); } return forum; Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/persistence/Message.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/persistence/Message.java,v diff -u -r1.30 -r1.31 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/persistence/Message.java 17 Sep 2006 06:22:30 -0000 1.30 +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/persistence/Message.java 11 Oct 2006 02:54:32 -0000 1.31 @@ -114,22 +114,19 @@ while(iter.hasNext()){ Attachment file = (Attachment)iter.next(); Attachment newFile = (Attachment) file.clone(); - if(toolContentHandler != null){ - //duplicate file node in repository - NodeKey keys = toolContentHandler.copyFile(file.getFileUuid()); - newFile.setFileUuid(keys.getUuid()); - newFile.setFileVersionId(keys.getVersion()); - } + // use common file node in repository +// if(toolContentHandler != null){ +// //duplicate file node in repository +// NodeKey keys = toolContentHandler.copyFile(file.getFileUuid()); +// newFile.setFileUuid(keys.getUuid()); +// newFile.setFileVersionId(keys.getVersion()); +// } set.add(newFile); } msg.attachments = set; } } catch (CloneNotSupportedException e) { log.error("When clone " + Forum.class + " failed"); - } catch (ItemNotFoundException e) { - log.error("When clone " + Forum.class + " failed"); - } catch (RepositoryCheckedException e) { - log.error("When clone " + Forum.class + " failed"); } return msg; Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java,v diff -u -r1.59 -r1.60 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java 10 Oct 2006 04:19:48 -0000 1.59 +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/AuthoringAction.java 11 Oct 2006 02:54:32 -0000 1.60 @@ -332,7 +332,7 @@ Attachment delAtt = (Attachment) iter.next(); iter.remove(); //delete from repository - forumService.deleteFromRepository(delAtt.getFileUuid(),delAtt.getFileVersionId()); + //forumService.deleteFromRepository(delAtt.getFileUuid(),delAtt.getFileVersionId()); //it is an existed att, then delete it from current attachmentPO if(delAtt.getUid() != null){ Iterator attIter = attPOSet.iterator(); @@ -359,7 +359,7 @@ Attachment delAtt = (Attachment) iter.next(); iter.remove(); //delete from repository - forumService.deleteFromRepository(delAtt.getFileUuid(),delAtt.getFileVersionId()); + //forumService.deleteFromRepository(delAtt.getFileUuid(),delAtt.getFileVersionId()); } //Handle message