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.17 -r1.18 --- lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java 15 Oct 2006 02:59:04 -0000 1.17 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/web/AuthoringAction.java 25 Oct 2006 03:48:06 -0000 1.18 @@ -30,17 +30,20 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.authoring.service.IAuthoringService; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.util.FileUtilException; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.util.audit.IAuditService; import org.lamsfoundation.lams.util.wddx.FlashMessage; import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; @@ -65,6 +68,12 @@ return (IAuthoringService) webContext.getBean(AuthoringConstants.AUTHORING_SERVICE_BEAN_NAME); } + private Integer getUserId() { + HttpSession ss = SessionManager.getSession(); + UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); + return user != null ? user.getUserID() : null; + } + /** 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 to the @@ -106,7 +115,8 @@ String wddxPacket; IAuthoringService authoringService = getAuthoringService(); try { - Long userID = new Long(WebUtil.readLongParam(request,"userID")); + Long userID = new Long(getUserId()); + wddxPacket = authoringService.getLearningDesignsForUser(userID); } catch (Exception e) { wddxPacket = handleException(e, "getLearningDesignsForUser", authoringService).serializeMessage(); Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java,v diff -u -r1.48 -r1.49 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java 10 Oct 2006 05:17:36 -0000 1.48 +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java 25 Oct 2006 03:48:07 -0000 1.49 @@ -675,7 +675,7 @@ HttpServletRequest request, HttpServletResponse response)throws IOException,LamsToolServiceException{ IMonitoringService monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); - Integer userID = new Integer(WebUtil.readIntParam(request,"userID")); + Integer userID = getUserId(); Long activityID = new Long(WebUtil.readLongParam(request,"activityID")); Long lessonID = new Long(WebUtil.readLongParam(request,AttributeNames.PARAM_LESSON_ID)); @@ -716,7 +716,7 @@ String wddxPacket = null; try { Long lessonID = new Long(WebUtil.readLongParam(request,"lessonID")); - Integer userID = new Integer(WebUtil.readIntParam(request,"userID")); + Integer userID = getUserId(); Integer targetWorkspaceFolderID = new Integer(WebUtil.readIntParam(request,"folderID")); wddxPacket = monitoringService.moveLesson(lessonID,targetWorkspaceFolderID,userID); } catch (Exception e) { @@ -735,7 +735,7 @@ String wddxPacket = null; try { Long lessonID = new Long(WebUtil.readLongParam(request,"lessonID")); - Integer userID = new Integer(WebUtil.readIntParam(request,"userID")); + Integer userID = getUserId(); String name = WebUtil.readStrParam(request,"name"); wddxPacket = monitoringService.renameLesson(lessonID,name,userID); } catch (Exception e) { @@ -795,13 +795,13 @@ try { - int userID = WebUtil.readIntParam(request,AttributeNames.PARAM_USER_ID); + Integer userID = getUserId(); long learningDesignID = WebUtil.readLongParam(request,AttributeNames.PARAM_LEARNINGDESIGN_ID); String title = WebUtil.readStrParam(request,"title"); String desc = WebUtil.readStrParam(request,"description"); // initialize the lesson - Lesson previewLesson = monitoringService.initializeLessonForPreview(title,desc,learningDesignID,new Integer(userID)); + Lesson previewLesson = monitoringService.initializeLessonForPreview(title,desc,learningDesignID,userID); if ( previewLesson != null ) { long lessonID = previewLesson.getLessonId().longValue();