Index: lams_build/lib/lams/lams-central.jar =================================================================== RCS file: /usr/local/cvsroot/lams_build/lib/lams/lams-central.jar,v diff -u -r1.34 -r1.35 Binary files differ 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.14 -r1.15 --- lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java 20 May 2006 11:13:47 -0000 1.14 +++ lams_central/src/java/org/lamsfoundation/lams/workspace/service/IWorkspaceManagementService.java 30 May 2006 07:20:29 -0000 1.15 @@ -318,14 +318,18 @@ public String getWorkspace(Integer userID) throws IOException; /** - * Retrieves the list of organisations in which the user has the specified role. - * in WDDX format + * Retrieves a tree of organisations in which the user has the specified role. + * If courseID is not set, then returns all organisations + * If courseID only is set, then return course organisationDTO and its children as its nodes + * If courseID && classID(s) are set, then course organisationDTO and its the nominated class + * organisationDTOs - most cases will have only single classID * @param userID * @param roles - * @param organisationID if null returns all organisations, if set returns child organisations for this organisation - * @return + * @param courseID + * @param classID + * @return organisationDTO hierarchy, in WDDX format. */ - public String getOrganisationsByUserRole(Integer userID, List roleNames, Integer organisationId) throws IOException; + public String getOrganisationsByUserRole(Integer userID, List roleNames, Integer courseId, List restrictToClassIds) throws IOException; /** * Returns the users within the Organisation with organisationID Index: lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java,v diff -u -r1.27 -r1.28 --- lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java 20 May 2006 11:13:47 -0000 1.27 +++ lams_central/src/java/org/lamsfoundation/lams/workspace/service/WorkspaceManagementService.java 30 May 2006 07:20:29 -0000 1.28 @@ -1383,19 +1383,19 @@ } /** - * @see org.lamsfoundation.lams.workspace.service.IWorkspaceManagementService#getOrganisationsByUserRole(Integer, String) + * @see org.lamsfoundation.lams.workspace.service.IWorkspaceManagementService#getOrganisationsByUserRole(Integer, List, Integer, List) */ - public String getOrganisationsByUserRole(Integer userID, List roleNames, Integer organisationId) throws IOException + public String getOrganisationsByUserRole(Integer userID, List roleNames, Integer courseId, List restrictToClassIds) throws IOException { User user = userDAO.getUserById(userID); if (user!=null) { - if ( organisationId == null ) { + if ( courseId == null ) { flashMessage = new FlashMessage( MSG_KEY_ORG_BY_ROLE, userMgmtService.getOrganisationsForUserByRole(user, roleNames)); } else { flashMessage = new FlashMessage( - MSG_KEY_ORG_BY_ROLE, userMgmtService.getOrganisationsForUserByRole(user, roleNames, organisationId)); + MSG_KEY_ORG_BY_ROLE, userMgmtService.getOrganisationsForUserByRole(user, roleNames, courseId, restrictToClassIds)); } } else flashMessage = FlashMessage.getNoSuchUserExists( Index: lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceAction.java,v diff -u -r1.15 -r1.16 --- lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceAction.java 20 May 2006 11:13:47 -0000 1.15 +++ lams_central/src/java/org/lamsfoundation/lams/workspace/web/WorkspaceAction.java 30 May 2006 07:20:28 -0000 1.16 @@ -33,6 +33,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; @@ -514,14 +516,33 @@ roleList.add(role); } - Integer orgId = WebUtil.readIntParam(request, AttributeNames.PARAM_ORGANISATION_ID,true); String wddxPacket = null; + Integer courseId = null; + String[] classIdStrings = null; try { + courseId = WebUtil.readIntParam(request, AttributeNames.PARAM_COURSE_ID,true); + classIdStrings = request.getParameterValues(AttributeNames.PARAM_CLASS_ID); + ArrayList classIds = new ArrayList(); + if ( classIdStrings != null ) { + for ( String str: classIdStrings) { + // any number format exception will be caught by the general catch + int classId = Integer.parseInt(str); + classIds.add(new Integer(classId)); + } + } IWorkspaceManagementService workspaceManagementService = getWorkspaceManagementService(); - wddxPacket = workspaceManagementService.getOrganisationsByUserRole(userID, roleList,orgId); + wddxPacket = workspaceManagementService.getOrganisationsByUserRole(userID, roleList,courseId,classIds); + } catch (Exception e) { - log.error("getOrganisationsByUserRole: Exception occured. userID "+userID+" role "+roles.toString(), e); + String error = new ToStringBuilder(this) + .append("") + .append("userID",userID) + .append("roles",roles) + .append("courseId",courseId) + .append("classIdStrings",classIdStrings) + .toString(); + log.error("getOrganisationsByUserRole: Exception occured. Request data "+error, e); FlashMessage flashMessage = FlashMessage.getExceptionOccured(IWorkspaceManagementService.MSG_KEY_ORG_BY_ROLE, e.getMessage()); wddxPacket = flashMessage.serializeMessage(); } Index: lams_central/web/WEB-INF/web.xml =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/WEB-INF/Attic/web.xml,v diff -u -r1.19 -r1.20 --- lams_central/web/WEB-INF/web.xml 11 May 2006 06:00:31 -0000 1.19 +++ lams_central/web/WEB-INF/web.xml 30 May 2006 07:20:28 -0000 1.20 @@ -176,6 +176,15 @@ 1 + + ExportToolContent + org.lamsfoundation.lams.authoring.web.ExportToolContentServlet + + + ImportToolContent + org.lamsfoundation.lams.authoring.web.ImportToolContentServlet + + action *.do @@ -193,6 +202,16 @@ /fckeditor/editor/filemanager/upload/simpleuploader + + ExportToolContent + /ExportToolContent + + + + ImportToolContent + /ImportToolContent + + flashCrashDump /flashCrashDump Index: lams_central/web/WEB-INF/struts/struts-config.xml =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/WEB-INF/struts/Attic/struts-config.xml,v diff -u -r1.10 -r1.11 --- lams_central/web/WEB-INF/struts/struts-config.xml 25 May 2006 01:01:50 -0000 1.10 +++ lams_central/web/WEB-INF/struts/struts-config.xml 30 May 2006 07:20:29 -0000 1.11 @@ -14,13 +14,13 @@ - +