Index: lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java =================================================================== diff -u -refca149a7fdbdff875aac4ebaa162cabe51d0d08 -r772f0f585ff29c3b9f51f8201682cc1db3bfee1c --- lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java (.../AuthoringAction.java) (revision efca149a7fdbdff875aac4ebaa162cabe51d0d08) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java (.../AuthoringAction.java) (revision 772f0f585ff29c3b9f51f8201682cc1db3bfee1c) @@ -34,6 +34,7 @@ import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; +import org.apache.commons.lang.StringUtils; import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; @@ -42,6 +43,7 @@ import org.apache.tomcat.util.json.JSONObject; import org.lamsfoundation.lams.authoring.service.IAuthoringService; import org.lamsfoundation.lams.learningdesign.dto.LicenseDTO; +import org.lamsfoundation.lams.learningdesign.service.ILearningDesignService; import org.lamsfoundation.lams.lesson.Lesson; import org.lamsfoundation.lams.monitoring.service.IMonitoringService; import org.lamsfoundation.lams.tool.IToolVO; @@ -69,7 +71,7 @@ * @author Manpreet Minhas * * @struts.action path = "/authoring/author" parameter = "method" validate = "false" - * + * @struts:action-forward name="openAutoring" path="/author2.jsp" */ public class AuthoringAction extends LamsDispatchAction { @@ -80,6 +82,7 @@ private static IUserManagementService userManagementService; private static ILamsToolService toolService; private static IAuthoringService authoringService; + private static ILearningDesignService learningDesignService; private Integer getUserId() { HttpSession ss = SessionManager.getSession(); @@ -93,6 +96,12 @@ return user != null ? user.getLocaleLanguage() : ""; } + public ActionForward openAuthoring(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException { + request.setAttribute("tools", getLearningDesignService().getToolDTOs(request.getRemoteUser())); + return mapping.findForward("openAutoring"); + } + /** * Output the supplied WDDX packet. If the request parameter USE_JSP_OUTPUT is set, then it sets the session * attribute "parameterName" to the wddx packet string. If USE_JSP_OUTPUT is not set, then the packet is written out @@ -323,7 +332,12 @@ // generate the next unique content ID for the tool Long toolContentID = authoringService.insertToolContentID(toolID); if (toolContentID != null) { - String contentFolderID = FileUtil.generateUniqueContentFolderID(); + + String contentFolderID = request.getParameter(AttributeNames.PARAM_CONTENT_FOLDER_ID); + if (StringUtils.isBlank(contentFolderID)) { + contentFolderID = FileUtil.generateUniqueContentFolderID(); + } + String authorUrl = authoringService.getToolAuthorUrl(toolID, toolContentID, contentFolderID); if (authorUrl != null) { JSONObject responseJSON = new JSONObject(); @@ -457,4 +471,14 @@ } return AuthoringAction.toolService; } + + + private ILearningDesignService getLearningDesignService() { + if (AuthoringAction.learningDesignService == null) { + WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + AuthoringAction.learningDesignService = (ILearningDesignService) ctx.getBean("learningDesignService"); + } + return AuthoringAction.learningDesignService; + } } \ No newline at end of file Fisheye: Tag 772f0f585ff29c3b9f51f8201682cc1db3bfee1c refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/web/AuthoringAction.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java =================================================================== diff -u -r606581007abbdaee5483777096f32ffac1c3e3eb -r772f0f585ff29c3b9f51f8201682cc1db3bfee1c --- lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java (.../HomeAction.java) (revision 606581007abbdaee5483777096f32ffac1c3e3eb) +++ lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java (.../HomeAction.java) (revision 772f0f585ff29c3b9f51f8201682cc1db3bfee1c) @@ -389,7 +389,7 @@ public ActionForward getFolderContents(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws UserAccessDeniedException, JSONException, IOException, RepositoryCheckedException { - Integer folderID = new Integer(WebUtil.readIntParam(req, "folderID")); + Integer folderID = WebUtil.readIntParam(req, "folderID", true); JSONObject responseJSON = getFolderContents(folderID, getUser().getUserID()); res.setContentType("application/json;charset=utf-8"); Index: lams_central/web/author2.jsp =================================================================== diff -u -ra32a2caaa30f22384bc822c874269f59c5a7c5f7 -r772f0f585ff29c3b9f51f8201682cc1db3bfee1c --- lams_central/web/author2.jsp (.../author2.jsp) (revision a32a2caaa30f22384bc822c874269f59c5a7c5f7) +++ lams_central/web/author2.jsp (.../author2.jsp) (revision 772f0f585ff29c3b9f51f8201682cc1db3bfee1c) @@ -10,18 +10,33 @@