Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McUploadedFile.java =================================================================== diff -u -r8522cd628329e0031e21b48f2750b1fd9b1842a6 -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McUploadedFile.java (.../McUploadedFile.java) (revision 8522cd628329e0031e21b48f2750b1fd9b1842a6) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/pojos/McUploadedFile.java (.../McUploadedFile.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -92,25 +92,11 @@ { McUploadedFile newMcUploadedFile=null; - try - { - String fileUuid = mcUploadedFile.getUuid(); - if(toolContentHandler != null){ - NodeKey copiedNodeKey = toolContentHandler.copyFile(new Long(mcUploadedFile.getUuid())); - logger.debug("copied NodeKey: " + copiedNodeKey); - logger.debug("copied NodeKey uuid: " + copiedNodeKey.getUuid().toString()); - fileUuid = copiedNodeKey.getUuid().toString(); - } - newMcUploadedFile = new McUploadedFile(fileUuid, + newMcUploadedFile = new McUploadedFile(mcUploadedFile.getUuid(), mcUploadedFile.isFileOnline(), mcUploadedFile.getFileName(), newMcContent); - } - catch(RepositoryCheckedException e) - { - logger.debug("error occurred: " + e); - } return newMcUploadedFile; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUploadedFile.java =================================================================== diff -u -r0db83894504dc7652d3670a6ce496605b961faa1 -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUploadedFile.java (.../QaUploadedFile.java) (revision 0db83894504dc7652d3670a6ce496605b961faa1) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/QaUploadedFile.java (.../QaUploadedFile.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -92,25 +92,10 @@ { QaUploadedFile newMcUploadedFile=null; - try - { - String fileUuid = qaUploadedFile.getUuid(); - if(toolContentHandler != null){ - NodeKey copiedNodeKey = toolContentHandler.copyFile(new Long(qaUploadedFile.getUuid())); - logger.debug("copied NodeKey: " + copiedNodeKey); - logger.debug("copied NodeKey uuid: " + copiedNodeKey.getUuid().toString()); - fileUuid = copiedNodeKey.getUuid().toString(); - } - newMcUploadedFile = new QaUploadedFile(fileUuid, + newMcUploadedFile = new QaUploadedFile(qaUploadedFile.getUuid(), qaUploadedFile.isFileOnline(), qaUploadedFile.getFileName(), newMcContent); - - } - catch(RepositoryCheckedException e) - { - logger.debug("error occurred: " + e); - } return newMcUploadedFile; } Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java =================================================================== diff -u -r24cbd649c978f88f34f4e80b5d8ab8ab2faefdcc -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java (.../QaAction.java) (revision 24cbd649c978f88f34f4e80b5d8ab8ab2faefdcc) +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaAction.java (.../QaAction.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -2019,27 +2019,7 @@ QaUploadedFile attachment = (QaUploadedFile) iter.next(); logger.debug("attachment: " + attachment); - /*remove entry from content repository. deleting a non-existent entry - shouldn't cause any errors.*/ - try - { - - if(attachment.getUuid()!= null) - { - getToolContentHandler().deleteFile(Long.getLong(attachment.getUuid())); - logger.error("deleted file with uuid: " + attachment.getUuid()); - } - } - catch (RepositoryCheckedException e) { - logger.error("Unable to delete file",e); - /* - ActionMessages am = new ActionMessages(); - am.add( ActionMessages.GLOBAL_MESSAGE, - new ActionMessage( "error.contentrepository" , - attachment.getFileName())); - saveErrors( request, am ); - */ - } + /* remove entry from db, leave in content repository. */ if ( attachment.getSubmissionId() != null ) { qaService.removeFile(attachment.getSubmissionId()); Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/Resource.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/Resource.java (.../Resource.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/model/Resource.java (.../Resource.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -128,13 +128,7 @@ while(iter.hasNext()){ ResourceItem item = (ResourceItem)iter.next(); ResourceItem newItem = (ResourceItem) item.clone(); -// if toolContentHandle is null, just clone old file without duplicate it in repository - if(toolContentHandler != null && item.getFileUuid() != null){ - //duplicate file node in repository - NodeKey keys = toolContentHandler.copyFile(item.getFileUuid()); - newItem.setFileUuid(keys.getUuid()); - newItem.setFileVersionId(keys.getVersion()); - } +// just clone old file without duplicate it in repository set.add(newItem); } resource.resourceItems = set; @@ -146,13 +140,8 @@ while(iter.hasNext()){ ResourceAttachment file = (ResourceAttachment)iter.next(); ResourceAttachment newFile = (ResourceAttachment) 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()); - } +// just clone old file without duplicate it in repository + set.add(newFile); } resource.attachments = set; @@ -163,10 +152,6 @@ } } catch (CloneNotSupportedException e) { log.error("When clone " + Resource.class + " failed"); - } catch (ItemNotFoundException e) { - log.error("When clone " + Resource.class + " failed"); - } catch (RepositoryCheckedException e) { - log.error("When clone " + Resource.class + " failed"); } return resource; Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/AuthoringAction.java =================================================================== diff -u -r2700025047410d38f40b3bd7c56966a9fc08bb29 -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 2700025047410d38f40b3bd7c56966a9fc08bb29) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -550,8 +550,6 @@ while(iter.hasNext()){ ResourceAttachment delAtt = (ResourceAttachment) iter.next(); iter.remove(); - //delete from repository - service.deleteFromRepository(delAtt.getFileUuid(),delAtt.getFileVersionId()); //it is an existed att, then delete it from current attachmentPO if(delAtt.getUid() != null){ Iterator attIter = attPOSet.iterator(); @@ -590,17 +588,13 @@ iter.remove(); if(item.getUid() != null) service.deleteResourceItem(item.getUid()); - if(item.getFileUuid() != null && item.getFileVersionId() != null) - service.deleteFromRepository(item.getFileUuid(),item.getFileVersionId()); } //handle resource item attachment file: List delItemAttList = getDeletedItemAttachmentList(sessionMap); iter = delItemAttList.iterator(); while(iter.hasNext()){ ResourceItem delAtt = (ResourceItem) iter.next(); iter.remove(); - //delete from repository - service.deleteFromRepository(delAtt.getFileUuid(),delAtt.getFileVersionId()); } //if miniview number is bigger than available items, then set it topics size Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/model/Notebook.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/model/Notebook.java (.../Notebook.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/model/Notebook.java (.../Notebook.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -395,13 +395,6 @@ NotebookAttachment originalFile = (NotebookAttachment) iter.next(); NotebookAttachment newFile = (NotebookAttachment) originalFile .clone(); - if (toolContentHandler != null) { - // duplicate file node in repository - NodeKey keys = toolContentHandler.copyFile(originalFile - .getFileUuid()); - newFile.setFileUuid(keys.getUuid()); - newFile.setFileVersionId(keys.getVersion()); - } set.add(newFile); } notebook.notebookAttachments = set; @@ -411,10 +404,6 @@ } catch (CloneNotSupportedException cnse) { log.error("Error cloning " + Notebook.class); - } catch (ItemNotFoundException infe) { - log.error("Item Not found " + Notebook.class); - } catch (RepositoryCheckedException rce) { - log.error("Repository checked exception " + Notebook.class); } return notebook; } Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java =================================================================== diff -u -ra1523835943285424159f4719d51af2794f94846 -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision a1523835943285424159f4719d51af2794f94846) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -172,9 +172,7 @@ } for (NotebookAttachment att : getAttList(KEY_DELETED_FILES, map)) { - // remove from repository and db - notebookService.deleteFromRepository(att.getFileUuid(), att - .getFileVersionId()); + // remove from db, leave in repository attachments.remove(att); } Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/SubmitFilesContent.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/SubmitFilesContent.java (.../SubmitFilesContent.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/SubmitFilesContent.java (.../SubmitFilesContent.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -284,12 +284,6 @@ while(iter.hasNext()){ InstructionFiles file = (InstructionFiles)iter.next(); InstructionFiles newFile = (InstructionFiles) file.clone(); - //duplicate file node in repository - if(toolContentHandler != null){ - NodeKey keys = toolContentHandler.copyFile(file.getUuID()); - newFile.setUuID(keys.getUuid()); - newFile.setVersionID(keys.getVersion()); - } set.add(newFile); } ((SubmitFilesContent)obj).instructionFiles= set; @@ -300,10 +294,6 @@ } } catch (CloneNotSupportedException e) { log.error("When clone " + SubmitFilesContent.class + " failed"); - } catch (ItemNotFoundException e) { - log.error("When clone " + SubmitFilesContent.class + " failed"); - } catch (RepositoryCheckedException e) { - log.error("When clone " + SubmitFilesContent.class + " failed"); } return obj; Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/AuthoringAction.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/AuthoringAction.java (.../AuthoringAction.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/AuthoringAction.java (.../AuthoringAction.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -243,8 +243,6 @@ iter = deleteAttachmentList.iterator(); while(iter.hasNext()){ InstructionFiles delAtt = (InstructionFiles) iter.next(); - //delete from repository - submitFilesService.deleteFromRepository(delAtt.getUuID(),delAtt.getVersionID()); //it is an existed att, then delete it from current attachmentPO if(delAtt.getUid() != null){ Iterator attIter = attPOSet.iterator(); Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/model/Scribe.java =================================================================== diff -u -r84283f3449a27ed45130e07c53d2cefc451ba537 -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/model/Scribe.java (.../Scribe.java) (revision 84283f3449a27ed45130e07c53d2cefc451ba537) +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/model/Scribe.java (.../Scribe.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -434,13 +434,6 @@ ScribeAttachment originalFile = (ScribeAttachment) iter.next(); ScribeAttachment newFile = (ScribeAttachment) originalFile .clone(); - if (toolContentHandler != null) { - // duplicate file node in repository - NodeKey keys = toolContentHandler.copyFile(originalFile - .getFileUuid()); - newFile.setFileUuid(keys.getUuid()); - newFile.setFileVersionId(keys.getVersion()); - } set.add(newFile); } scribe.scribeAttachments = set; @@ -467,10 +460,6 @@ } catch (CloneNotSupportedException cnse) { log.error("Error cloning " + Scribe.class); - } catch (ItemNotFoundException infe) { - log.error("Item Not found " + Scribe.class); - } catch (RepositoryCheckedException rce) { - log.error("Repository checked exception " + Scribe.class); } return scribe; } Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/AuthoringAction.java =================================================================== diff -u -ra1523835943285424159f4719d51af2794f94846 -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision a1523835943285424159f4719d51af2794f94846) +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -183,9 +183,7 @@ } for (ScribeAttachment att : getAttList(KEY_DELETED_FILES, map)) { - // remove from repository and db - scribeService.deleteFromRepository(att.getFileUuid(), att - .getFileVersionId()); + // remove from db, leave in repository attachments.remove(att); } Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Survey.java =================================================================== diff -u -r6a5d35ec57dde95eae93fb628d669af257d36949 -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Survey.java (.../Survey.java) (revision 6a5d35ec57dde95eae93fb628d669af257d36949) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/model/Survey.java (.../Survey.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -136,13 +136,8 @@ while(iter.hasNext()){ SurveyAttachment file = (SurveyAttachment)iter.next(); SurveyAttachment newFile = (SurveyAttachment) 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); } survey.attachments = set; @@ -153,10 +148,6 @@ } } catch (CloneNotSupportedException e) { log.error("When clone " + Survey.class + " failed"); - } catch (ItemNotFoundException e) { - log.error("When clone " + Survey.class + " failed"); - } catch (RepositoryCheckedException e) { - log.error("When clone " + Survey.class + " failed"); } return survey; Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java =================================================================== diff -u -r2700025047410d38f40b3bd7c56966a9fc08bb29 -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 2700025047410d38f40b3bd7c56966a9fc08bb29) +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/action/AuthoringAction.java (.../AuthoringAction.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -551,8 +551,6 @@ while(iter.hasNext()){ SurveyAttachment delAtt = (SurveyAttachment) iter.next(); iter.remove(); - //delete from repository - service.deleteFromRepository(delAtt.getFileUuid(),delAtt.getFileVersionId()); //it is an existed att, then delete it from current attachmentPO if(delAtt.getUid() != null){ Iterator attIter = attPOSet.iterator(); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUploadedFile.java =================================================================== diff -u -r00759d7592ccc90e8769763524afb69546f641d4 -r6469a3c8ad3e545e2f1929947d3c46b040896632 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUploadedFile.java (.../VoteUploadedFile.java) (revision 00759d7592ccc90e8769763524afb69546f641d4) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/pojos/VoteUploadedFile.java (.../VoteUploadedFile.java) (revision 6469a3c8ad3e545e2f1929947d3c46b040896632) @@ -83,25 +83,11 @@ { VoteUploadedFile newMcUploadedFile=null; - try - { - String fileUuid = voteUploadedFile.getUuid(); - if(toolContentHandler != null){ - NodeKey copiedNodeKey = toolContentHandler.copyFile(new Long(voteUploadedFile.getUuid())); - logger.debug("copied NodeKey: " + copiedNodeKey); - logger.debug("copied NodeKey uuid: " + copiedNodeKey.getUuid().toString()); - fileUuid = copiedNodeKey.getUuid().toString(); - } - newMcUploadedFile = new VoteUploadedFile(fileUuid, + newMcUploadedFile = new VoteUploadedFile(voteUploadedFile.getUuid(), voteUploadedFile.isFileOnline(), voteUploadedFile.getFileName(), newMcContent); - } - catch(RepositoryCheckedException e) - { - logger.debug("error occurred: " + e); - } return newMcUploadedFile; }