Index: lams_build/lib/lams/lams-central.jar =================================================================== RCS file: /usr/local/cvsroot/lams_build/lib/lams/lams-central.jar,v diff -u -r1.24 -r1.25 Binary files differ Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java,v diff -u -r1.9 -r1.10 --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 25 Jan 2006 00:21:49 -0000 1.9 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 27 Jan 2006 06:54:48 -0000 1.10 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java,v diff -u -r1.4 -r1.5 --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java 24 Jan 2006 11:32:19 -0000 1.4 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java 27 Jan 2006 06:54:48 -0000 1.5 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java,v diff -u -r1.5 -r1.6 --- lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java 24 Jan 2006 11:32:20 -0000 1.5 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java 27 Jan 2006 06:54:48 -0000 1.6 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java,v diff -u -r1.5 -r1.6 --- lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java 24 Jan 2006 11:35:12 -0000 1.5 +++ lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java 27 Jan 2006 06:54:48 -0000 1.6 @@ -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. - *