Index: lams_build/lib/lams/lams-central.jar =================================================================== RCS file: /usr/local/cvsroot/lams_build/lib/lams/lams-central.jar,v diff -u -r1.73 -r1.74 Binary files differ Index: lams_build/lib/lams/lams.jar =================================================================== RCS file: /usr/local/cvsroot/lams_build/lib/lams/lams.jar,v diff -u -r1.385 -r1.386 Binary files differ Fisheye: Tag 1.2 refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/authoring/dto/ToolDTO.java'. Fisheye: No comparison available. Pass `N' to diff? 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.96 -r1.97 --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 29 Jul 2013 12:15:38 -0000 1.96 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java 10 Sep 2013 08:32:44 -0000 1.97 @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; +import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -72,6 +73,8 @@ import org.lamsfoundation.lams.learningdesign.dto.AuthoringActivityDTO; import org.lamsfoundation.lams.learningdesign.dto.DesignDetailDTO; import org.lamsfoundation.lams.learningdesign.dto.LearningDesignDTO; +import org.lamsfoundation.lams.learningdesign.dto.LearningLibraryDTO; +import org.lamsfoundation.lams.learningdesign.dto.LibraryActivityDTO; import org.lamsfoundation.lams.learningdesign.dto.ValidationErrorDTO; import org.lamsfoundation.lams.learningdesign.exception.LearningDesignException; import org.lamsfoundation.lams.learningdesign.service.ILearningDesignService; @@ -109,6 +112,7 @@ import org.lamsfoundation.lams.util.wddx.FlashMessage; import org.lamsfoundation.lams.util.wddx.WDDXProcessor; import org.lamsfoundation.lams.util.wddx.WDDXTAGS; +import org.lamsfoundation.lams.web.DisplayGroupAction; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; import org.lamsfoundation.lams.workspace.service.IWorkspaceManagementService; 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.37 -r1.38 --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java 29 Jul 2013 12:15:38 -0000 1.37 +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java 10 Sep 2013 08:32:44 -0000 1.38 @@ -27,7 +27,6 @@ import java.util.List; import java.util.Vector; -import org.lamsfoundation.lams.authoring.dto.ToolDTO; import org.lamsfoundation.lams.learningdesign.Activity; import org.lamsfoundation.lams.learningdesign.GateActivity; import org.lamsfoundation.lams.learningdesign.Grouping; Index: lams_central/src/java/org/lamsfoundation/lams/web/AuthoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/Attic/AuthoringAction.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_central/src/java/org/lamsfoundation/lams/web/AuthoringAction.java 10 Sep 2013 08:32:44 -0000 1.1 @@ -0,0 +1,77 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id: AuthoringAction.java,v 1.1 2013/09/10 08:32:44 marcin Exp $ */ +package org.lamsfoundation.lams.web; + +import java.io.IOException; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +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.apache.struts.actions.DispatchAction; +import org.lamsfoundation.lams.authoring.service.IAuthoringService; +import org.lamsfoundation.lams.learningdesign.service.ILearningDesignService; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * this is an action where all lams client environments launch. initial configuration of the individual environment + * setting is done here. + * + * @struts:action path="/authoring" validate="false" parameter="method" + * @struts:action-forward name="openAutoring" path="/author2.jsp" + */ +public class AuthoringAction extends DispatchAction { + private static Logger log = Logger.getLogger(AuthoringAction.class); + + private static IAuthoringService authoringService; + private static ILearningDesignService learningDesignService; + + public ActionForward openAuthoring(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException { + request.setAttribute("tools", getLearningDesignService().getToolDTOs(request.getRemoteUser())); + return mapping.findForward("openAutoring"); + } + + private IAuthoringService getAuthoringService() { + if (AuthoringAction.authoringService == null) { + WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + AuthoringAction.authoringService = (IAuthoringService) ctx.getBean("authoringService"); + } + return AuthoringAction.authoringService; + } + + 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 Index: lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java,v diff -u -r1.42 -r1.43 --- lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java 20 Aug 2013 12:17:10 -0000 1.42 +++ lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java 10 Sep 2013 08:32:44 -0000 1.43 @@ -44,7 +44,6 @@ import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; -import org.lamsfoundation.lams.authoring.dto.ToolDTO; import org.lamsfoundation.lams.index.IndexLessonBean; import org.lamsfoundation.lams.index.IndexLinkBean; import org.lamsfoundation.lams.index.IndexOrgBean; @@ -72,15 +71,6 @@ * @struts.action-forward name="group" path="/group.jsp" */ public class DisplayGroupAction extends Action { - - // sorts Tool display names - private static final Comparator TOOL_NAME_COMPARATOR = new Comparator() { - @Override - public int compare(ToolDTO o1, ToolDTO o2) { - return o1.getToolDisplayName().toLowerCase().compareTo(o2.getToolDisplayName().toLowerCase()); - } - }; - private static Logger log = Logger.getLogger(DisplayGroupAction.class); private static IUserManagementService service; private static LessonService lessonService; @@ -121,7 +111,7 @@ if (org.getEnableSingleActivityLessons() && (roles.contains(Role.ROLE_GROUP_MANAGER) || roles.contains(Role.ROLE_MONITOR))) { // if sinble activity lessons are enabled, put sorted list of tools - request.setAttribute("tools", getToolDTOs(request.getRemoteUser())); + request.setAttribute("tools", getLearningDesignService().getToolDTOs(request.getRemoteUser())); } } @@ -368,30 +358,6 @@ return map; } - /** - * Gets basic information on available tools: IDs and i18n names. - */ - private List getToolDTOs(String userName) throws IOException { - User user = (User) getService().findByProperty(User.class, "login", userName).get(0); - String languageCode = user.getLocale().getLanguageIsoCode(); - ArrayList learningLibraries = getLearningDesignService().getAllLearningLibraryDetails( - languageCode); - List tools = new ArrayList(); - for (LearningLibraryDTO learningLibrary : learningLibraries) { - // skip invalid and complex tools - if (learningLibrary.getValidFlag() && (learningLibrary.getTemplateActivities().size() == 1)) { - ToolDTO tool = new ToolDTO(); - tool.setToolId(learningLibrary.getLearningLibraryID()); - tool.setToolDisplayName(((LibraryActivityDTO) learningLibrary.getTemplateActivities().get(0)) - .getActivityTitle()); - tools.add(tool); - } - } - - Collections.sort(tools, DisplayGroupAction.TOOL_NAME_COMPARATOR); - return tools; - } - private IUserManagementService getService() { if (DisplayGroupAction.service == null) { WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() Index: lams_central/web/author2.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/Attic/author2.jsp,v diff -u -r1.1 -r1.2 --- lams_central/web/author2.jsp 3 Sep 2013 10:57:16 -0000 1.1 +++ lams_central/web/author2.jsp 10 Sep 2013 08:32:44 -0000 1.2 @@ -8,17 +8,72 @@ Flashless Authoring + + -
+ + + + + +
+
+ +
+ + + +
+
+
+
+
\ No newline at end of file Index: lams_central/web/main.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/main.jsp,v diff -u -r1.67 -r1.68 --- lams_central/web/main.jsp 3 Sep 2013 10:57:16 -0000 1.67 +++ lams_central/web/main.jsp 10 Sep 2013 08:32:44 -0000 1.68 @@ -242,7 +242,7 @@