Index: lams_build/lib/lams/lams-central.jar =================================================================== diff -u -rcdfe4624503ed79494cf91dddcbf1f544f83aab2 -rb31438f14603ef90bb73d6a0621a6b3e10f01ba7 Binary files differ Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java =================================================================== diff -u -r93895cc6ca6a7ca99b3b1706ae141978a5ca0612 -rb31438f14603ef90bb73d6a0621a6b3e10f01ba7 --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision 93895cc6ca6a7ca99b3b1706ae141978a5ca0612) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision b31438f14603ef90bb73d6a0621a6b3e10f01ba7) @@ -70,9 +70,7 @@ import org.lamsfoundation.lams.util.ConfigurationKeys; import org.lamsfoundation.lams.util.wddx.FlashMessage; import org.lamsfoundation.lams.util.wddx.WDDXProcessor; -import org.lamsfoundation.lams.authoring.LearningDesignValidator; - import com.allaire.wddx.WddxDeserializationException; @@ -240,7 +238,7 @@ } return flashMessage.serializeMessage(); } - public String copyLearningDesign(Long originalDesignID,Integer copyType, + public LearningDesign copyLearningDesign(Long originalDesignID,Integer copyType, Integer userID, Integer workspaceFolderID)throws UserException, LearningDesignException, WorkspaceFolderException, IOException{ @@ -256,9 +254,7 @@ if(workspaceFolder==null) throw new WorkspaceFolderException("No such WorkspaceFolder with workspace_folder_id of:" + workspaceFolderID + " exists"); - LearningDesign designCopy = copyLearningDesign(originalDesign,copyType,user,workspaceFolder); - flashMessage = new FlashMessage("copyLearningDesign", designCopy.getLearningDesignId()); - return flashMessage.serializeMessage(); + return copyLearningDesign(originalDesign,copyType,user,workspaceFolder); } /** @@ -422,9 +418,8 @@ groupingDAO,toolDAO,groupDAO,transitionDAO); try { LearningDesign design = extractor.extractLearningDesign(table); - LearningDesignValidator validator = new LearningDesignValidator(learningDesignDAO); - flashMessage = validator.validateLearningDesign(design); - + learningDesignDAO.insert(design); + flashMessage = new FlashMessage(IAuthoringService.STORE_LD_MESSAGE_KEY,design.getLearningDesignId()); } catch ( ObjectExtractorException e ) { flashMessage = new FlashMessage(IAuthoringService.STORE_LD_MESSAGE_KEY, "Invalid Object in WDDX packet. Error was "+e.getMessage(), Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java =================================================================== diff -u -r8773d184c34809bac6172def0c7ad0fc26fe515b -rb31438f14603ef90bb73d6a0621a6b3e10f01ba7 --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java (.../IAuthoringService.java) (revision 8773d184c34809bac6172def0c7ad0fc26fe515b) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java (.../IAuthoringService.java) (revision b31438f14603ef90bb73d6a0621a6b3e10f01ba7) @@ -71,7 +71,8 @@ public LearningDesign copyLearningDesign(LearningDesign originalLearningDesign,Integer copyType,User user, WorkspaceFolder workspaceFolder); /** * Create a copy of learning design as per the requested learning design - * and saves it in the given workspacefoler + * and saves it in the given workspacefolder. Designed to be called when user tries + * to copy a learning design using the Flash interface. * * @param originalLearningDesingID the source learning design id. * @param copyType purpose of copying the design. Can have one of the follwing values @@ -82,9 +83,9 @@ * * @param userID The user_id of the user who has sent this request(author/teacher) * @param workspaceFolderID The workspacefolder where this copy of the design would be saved - * @return String Acknowledgment message for FLASH in WDDX format + * @return new LearningDesign */ - public String copyLearningDesign(Long originalLearningDesignID,Integer copyType, + public LearningDesign copyLearningDesign(Long originalLearningDesignID,Integer copyType, Integer userID, Integer workspaceFolder)throws UserException, LearningDesignException, WorkspaceFolderException, IOException; /** Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java =================================================================== diff -u -r8773d184c34809bac6172def0c7ad0fc26fe515b -rb31438f14603ef90bb73d6a0621a6b3e10f01ba7 --- lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java (.../AuthoringAction.java) (revision 8773d184c34809bac6172def0c7ad0fc26fe515b) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java (.../AuthoringAction.java) (revision b31438f14603ef90bb73d6a0621a6b3e10f01ba7) @@ -107,21 +107,6 @@ return outputPacket(mapping, request, response, wddxPacket, "details"); } - public ActionForward copyLearningDesign(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response)throws ServletException, IOException, - UserException, WorkspaceFolderException, - LearningDesignException{ - - Long originalDesignID = new Long(WebUtil.readLongParam(request,"originalDesignID")); - Integer workspaceFolderID = new Integer(WebUtil.readIntParam(request,"workspaceFolderID")); - Integer userID = new Integer(WebUtil.readIntParam(request,"userID")); - Integer copyType = new Integer(WebUtil.readIntParam(request,"copyType")); - IAuthoringService authoringService = getAuthoringService(); - String message = authoringService.copyLearningDesign(originalDesignID,copyType,userID,workspaceFolderID); - return outputPacket(mapping, request, response, message, "message"); - } public ActionForward getLearningDesignsForUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, Index: lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java =================================================================== diff -u -r24e81813a7f7ce5a240c6bf7f4e3b70d55ce2f56 -rb31438f14603ef90bb73d6a0621a6b3e10f01ba7 --- lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java (.../IWorkspaceManagementService.java) (revision 24e81813a7f7ce5a240c6bf7f4e3b70d55ce2f56) +++ lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java (.../IWorkspaceManagementService.java) (revision b31438f14603ef90bb73d6a0621a6b3e10f01ba7) @@ -126,90 +126,56 @@ /** - * This method deletes the WorkspaceFolder with given - * workspaceFolderID. But before it does so it checks whether the - * User is authorized to perform this action
- * - *

Note:

To be able to a delete a WorkspaceFolder - * successfully you have to keep the following things in mind - *

- * - * @param workspaceFolderID The WorkspaceFolder to be deleted + * This method deletes an entry from a workspace. It may be a folder, + * a learning design or an arbitrary resource. It works out what the resource + * is and then calls the other deletion methods. Currently folders, files and learning + * designs are supported - all other types return an error. + *

+ * @param resourceID The id to be deleted. May be a learning design id + * or a folder id. + * @param resourceType The resource type sent to the client in the FolderContentDTO. * @param userID The User who has requested this operation * @return String The acknowledgement/error message in WDDX format for FLASH * @throws IOException */ - public String deleteFolder(Integer workspaceFolderID, Integer userID)throws IOException; - + public String deleteResource(Long resourceID, String resourceType, Integer userID) + throws IOException; + /** - * This method deletes a LearningDesign with given learningDesignID - * provied the User is authorized to do so. - *

Note:

- *

- * @param learningDesignID The learning_design_id of the - * LearningDesign to be deleted. - * @param userID The user_id of the User who has - * requested this opeartion - * @return String The acknowledgement/error message in WDDX format for FLASH - * @throws IOException - */ - public String deleteLearningDesign(Long learningDesignID, Integer userID)throws IOException; - - /** - * This method copies one folder inside another folder. To be able to - * successfully perform this action following conditions must be met in the - * order they are listed. - *