Ticket
to login and access the Content Repository.
+ *
+ * A valid ticket is needed in order to access the content from the
+ * repository. This method would be called evertime the tool needs to
+ * upload/download files from the content repository.
+ *
+ * @return ITicket The ticket for repostory access
+ * @throws SubmitFilesException
+ */
+ private ITicket getRepositoryLoginTicket() throws GmapException {
+ repositoryService = RepositoryProxy.getRepositoryService();
+ ICredentials credentials = new SimpleCredentials(
+ GmapToolContentHandler.repositoryUser,
+ GmapToolContentHandler.repositoryId);
+ try {
+ ITicket ticket = repositoryService.login(credentials,
+ GmapToolContentHandler.repositoryWorkspaceName);
+ return ticket;
+ } catch (AccessDeniedException ae) {
+ throw new GmapException("Access Denied to repository."
+ + ae.getMessage());
+ } catch (WorkspaceNotFoundException we) {
+ throw new GmapException("Workspace not found."
+ + we.getMessage());
+ } catch (LoginException e) {
+ throw new GmapException("Login failed." + e.getMessage());
+ }
+ }
+
+ /* ===============Methods implemented from ToolContentImport102Manager =============== */
+
+
+ /**
+ * Import the data for a 1.0.2 Gmap
+ */
+ public void import102ToolContent(Long toolContentId, UserDTO user, Hashtable importValues)
+ {
+ Date now = new Date();
+
+ Gmap gmap = new Gmap();
+ gmap.setContentInUse(Boolean.FALSE);
+ gmap.setCreateBy(new Long(user.getUserID().longValue()));
+ gmap.setCreateDate(now);
+ gmap.setDefineLater(Boolean.FALSE);
+ gmap.setInstructions(WebUtil.convertNewlines((String)importValues.get(ToolContentImport102Manager.CONTENT_BODY)));
+ gmap.setLockOnFinished(Boolean.TRUE);
+ gmap.setOfflineInstructions(null);
+ gmap.setOnlineInstructions(null);
+ gmap.setRunOffline(Boolean.FALSE);
+ gmap.setTitle((String)importValues.get(ToolContentImport102Manager.CONTENT_TITLE));
+ gmap.setToolContentId(toolContentId);
+ gmap.setUpdateDate(now);
+ gmap.setAllowRichEditor(Boolean.FALSE);
+ // leave as empty, no need to set them to anything.
+ //setGmapAttachments(Set gmapAttachments);
+ //setGmapSessions(Set gmapSessions);
+ gmapDAO.saveOrUpdate(gmap);
+ }
+
+ /** Set the description, throws away the title value as this is not supported in 2.0 */
+ public void setReflectiveData(Long toolContentId, String title, String description)
+ throws ToolException, DataMissingException {
+
+ logger.warn("Setting the reflective field on a gmap. This doesn't make sense as the gmap is for reflection and we don't reflect on reflection!");
+ Gmap gmap = getGmapByContentId(toolContentId);
+ if ( gmap == null ) {
+ throw new DataMissingException("Unable to set reflective data titled "+title
+ +" on activity toolContentId "+toolContentId
+ +" as the tool content does not exist.");
+ }
+
+ gmap.setInstructions(description);
+ }
+
+ //=========================================================================================
+ /* ********** Used by Spring to "inject" the linked objects ************* */
+
+ public IGmapAttachmentDAO getGmapAttachmentDAO() {
+ return gmapAttachmentDAO;
+ }
+
+ public void setGmapAttachmentDAO(IGmapAttachmentDAO attachmentDAO) {
+ this.gmapAttachmentDAO = attachmentDAO;
+ }
+
+ public IGmapDAO getGmapDAO() {
+ return gmapDAO;
+ }
+
+ public void setGmapDAO(IGmapDAO gmapDAO) {
+ this.gmapDAO = gmapDAO;
+ }
+
+ public IToolContentHandler getGmapToolContentHandler() {
+ return gmapToolContentHandler;
+ }
+
+ public void setGmapToolContentHandler(
+ IToolContentHandler gmapToolContentHandler) {
+ this.gmapToolContentHandler = gmapToolContentHandler;
+ }
+
+ public IGmapSessionDAO getGmapSessionDAO() {
+ return gmapSessionDAO;
+ }
+
+ public void setGmapSessionDAO(IGmapSessionDAO sessionDAO) {
+ this.gmapSessionDAO = sessionDAO;
+ }
+
+ public ILamsToolService getToolService() {
+ return toolService;
+ }
+
+ public void setToolService(ILamsToolService toolService) {
+ this.toolService = toolService;
+ }
+
+ public IGmapUserDAO getGmapUserDAO() {
+ return gmapUserDAO;
+ }
+
+ public void setGmapUserDAO(IGmapUserDAO userDAO) {
+ this.gmapUserDAO = userDAO;
+ }
+
+ public ILearnerService getLearnerService() {
+ return learnerService;
+ }
+
+ public void setLearnerService(ILearnerService learnerService) {
+ this.learnerService = learnerService;
+ }
+
+ public IExportToolContentService getExportContentService() {
+ return exportContentService;
+ }
+
+ public void setExportContentService(
+ IExportToolContentService exportContentService) {
+ this.exportContentService = exportContentService;
+ }
+
+ public ICoreNotebookService getCoreNotebookService() {
+ return coreNotebookService;
+ }
+
+ public void setCoreNotebookService(ICoreNotebookService coreNotebookService) {
+ this.coreNotebookService = coreNotebookService;
+ }
+}
Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/GmapServiceProxy.java
===================================================================
diff -u
--- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/GmapServiceProxy.java (revision 0)
+++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/GmapServiceProxy.java (revision 3299d560146318cb6f26ec2b234e3af70ec21eba)
@@ -0,0 +1,79 @@
+/****************************************************************
+ * 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 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$$ */
+
+package org.lamsfoundation.lams.tool.gmap.service;
+
+import javax.servlet.ServletContext;
+
+import org.lamsfoundation.lams.tool.ToolContentManager;
+import org.lamsfoundation.lams.tool.ToolSessionManager;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+
+
+/**
+ * This class act as the proxy between web layer and service layer. It is + * designed to decouple the presentation logic and business logic completely. + * In this way, the presentation tier will no longer be aware of the changes in + * service layer. Therefore we can feel free to switch the business logic + * implementation.
+ */ + +public class GmapServiceProxy { + + public static final IGmapService getGmapService(ServletContext servletContext) + { + return (IGmapService)getGmapDomainService(servletContext); + } + + private static Object getGmapDomainService(ServletContext servletContext) + { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); + return wac.getBean("gmapService"); + } + + /* + * Return the gmap tool version of tool session manager implementation. + * It will delegate to the Spring helper method to retrieve the proper + * bean from Spring bean factory. + * @param servletContext the servletContext for current application + * @return noticeboard service object.*/ + public static final ToolSessionManager getGmapSessionManager(ServletContext servletContext) + { + return (ToolSessionManager)getGmapDomainService(servletContext); + } + + + /* + * Return the gmap tool version of tool content manager implementation. + * It will delegate to the Spring helper method to retrieve the proper + * bean from Spring bean factory. + * @param servletContext the servletContext for current application + * @return noticeboard service object. */ + public static final ToolContentManager getGmapContentManager(ServletContext servletContext) + { + return (ToolContentManager)getGmapDomainService(servletContext); + } + +} Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/IGmapService.java =================================================================== diff -u --- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/IGmapService.java (revision 0) +++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/service/IGmapService.java (revision 3299d560146318cb6f26ec2b234e3af70ec21eba) @@ -0,0 +1,166 @@ +/**************************************************************** + * 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 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$$ */ + +package org.lamsfoundation.lams.tool.gmap.service; + +import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.notebook.model.NotebookEntry; +import org.lamsfoundation.lams.tool.gmap.model.Gmap; +import org.lamsfoundation.lams.tool.gmap.model.GmapAttachment; +import org.lamsfoundation.lams.tool.gmap.model.GmapSession; +import org.lamsfoundation.lams.tool.gmap.model.GmapUser; +import org.lamsfoundation.lams.tool.gmap.util.GmapException; +import org.lamsfoundation.lams.usermanagement.dto.UserDTO; + +/** + * Defines the services available to the web layer from the Gmap Service + */ +public interface IGmapService { + /** + * Makes a copy of the default content and assigns it a newContentID + * + * @params newContentID + * @return + */ + public Gmap copyDefaultContent(Long newContentID); + + /** + * Returns an instance of the Gmap tools default content. + * + * @return + */ + public Gmap getDefaultContent(); + + /** + * @param toolSignature + * @return + */ + public Long getDefaultContentIdBySignature(String toolSignature); + + /** + * @param toolContentID + * @return + */ + public Gmap getGmapByContentId(Long toolContentID); + + /** + * @param toolContentId + * @param file + * @param type + * @return + */ + public GmapAttachment uploadFileToContent(Long toolContentId, + FormFile file, String type); + + /** + * @param uuid + * @param versionID + */ + public void deleteFromRepository(Long uuid, Long versionID) + throws GmapException; + + /** + * @param contentID + * @param uuid + * @param versionID + * @param type + */ + public void deleteInstructionFile(Long contentID, Long uuid, + Long versionID, String type); + + /** + * @param gmap + */ + public void saveOrUpdateGmap(Gmap gmap); + + /** + * @param toolSessionId + * @return + */ + public GmapSession getSessionBySessionId(Long toolSessionId); + + /** + * @param gmapSession + */ + public void saveOrUpdateGmapSession(GmapSession gmapSession); + + /** + * + * @param userId + * @param toolSessionId + * @return + */ + public GmapUser getUserByUserIdAndSessionId(Long userId, + Long toolSessionId); + + /** + * + * @param uid + * @return + */ + public GmapUser getUserByUID(Long uid); + + /** + * + * @param gmapUser + */ + public void saveOrUpdateGmapUser(GmapUser gmapUser); + + /** + * + * @param user + * @param gmapSession + * @return + */ + public GmapUser createGmapUser(UserDTO user, + GmapSession gmapSession); + + /** + * + * @param id + * @param idType + * @param signature + * @param userID + * @param title + * @param entry + * @return + */ + Long createNotebookEntry(Long id, Integer idType, String signature, + Integer userID, String entry); + + /** + * + * @param uid + * @return + */ + NotebookEntry getEntry(Long uid); + + /** + * + * @param uid + * @param title + * @param entry + */ + void updateEntry(Long uid, String entry); +} Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/util/GmapConstants.java =================================================================== diff -u --- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/util/GmapConstants.java (revision 0) +++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/util/GmapConstants.java (revision 3299d560146318cb6f26ec2b234e3af70ec21eba) @@ -0,0 +1,51 @@ +/**************************************************************** + * 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 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$$ */ + +package org.lamsfoundation.lams.tool.gmap.util; + +public interface GmapConstants { + public static final String TOOL_SIGNATURE = "lagmap10"; + + // Gmap session status + public static final Integer SESSION_NOT_STARTED = new Integer(0); + public static final Integer SESSION_IN_PROGRESS = new Integer(1); + public static final Integer SESSION_COMPLETED = new Integer(2); + + public static final String AUTHORING_DEFAULT_TAB = "1"; + public static final String ATTACHMENT_LIST = "attachmentList"; + public static final String DELETED_ATTACHMENT_LIST = "deletedAttachmentList"; + public static final String AUTH_SESSION_ID_COUNTER = "authoringSessionIdCounter"; + public static final String AUTH_SESSION_ID = "authoringSessionId"; + + public static final int MONITORING_SUMMARY_MAX_MESSAGES = 5; + + // Attribute names + public static final String ATTR_MESSAGE = "message"; + public static final String ATTR_SESSION_MAP = "sessionMap"; + + // Parameter names + public static final String PARAM_PARENT_PAGE = "parentPage"; + + static final String FILTER_REPLACE_TEXT = "***"; +} Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/util/GmapException.java =================================================================== diff -u --- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/util/GmapException.java (revision 0) +++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/util/GmapException.java (revision 3299d560146318cb6f26ec2b234e3af70ec21eba) @@ -0,0 +1,57 @@ +/**************************************************************** + * 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 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$$ */ + +package org.lamsfoundation.lams.tool.gmap.util; + +/** + * + * @author Anthony Sukkar + * + */ +public class GmapException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = -5518806968051758859L; + + public GmapException(String message) { + super(message); + } + + public GmapException(String message, Throwable cause) { + super(message, cause); + } + + public GmapException() { + super(); + + } + + public GmapException(Throwable cause) { + super(cause); + + } + +} Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/util/GmapToolContentHandler.java =================================================================== diff -u --- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/util/GmapToolContentHandler.java (revision 0) +++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/util/GmapToolContentHandler.java (revision 3299d560146318cb6f26ec2b234e3af70ec21eba) @@ -0,0 +1,76 @@ +/**************************************************************** + * 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 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$$ */ + +package org.lamsfoundation.lams.tool.gmap.util; + +import org.lamsfoundation.lams.contentrepository.client.ToolContentHandler; + +/** + * Simple client for accessing the content repository. + */ +public class GmapToolContentHandler extends ToolContentHandler { + + // TODO these three fields were changed to public, since accessor methods + // cannot be made static. Check if we can do this a better way. + public static String repositoryWorkspaceName = "gmapworkspace"; + + public static String repositoryUser = "gmap"; + + public static char[] repositoryId = { 'l', 'a', 'm', 's', '-', 'e', 'x' }; + + /** + * + */ + public GmapToolContentHandler() { + super(); + } + + /* + * (non-Javadoc) + * + * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryWorkspaceName() + */ + public String getRepositoryWorkspaceName() { + return repositoryWorkspaceName; + } + + /* + * (non-Javadoc) + * + * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryUser() + */ + public String getRepositoryUser() { + return repositoryUser; + } + + /* + * (non-Javadoc) + * + * @see org.lamsfoundation.lams.contentrepository.client.ToolContentHandler#getRepositoryId() + */ + public char[] getRepositoryId() { + return repositoryId; + } + +} Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/AuthoringAction.java =================================================================== diff -u --- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/AuthoringAction.java (revision 0) +++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/AuthoringAction.java (revision 3299d560146318cb6f26ec2b234e3af70ec21eba) @@ -0,0 +1,478 @@ +/**************************************************************** + * 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 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$$ */ + +package org.lamsfoundation.lams.tool.gmap.web.actions; + +import java.util.Date; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang.StringUtils; +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.action.ActionMessages; +import org.apache.struts.upload.FormFile; +import org.lamsfoundation.lams.authoring.web.AuthoringConstants; +import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.gmap.model.Gmap; +import org.lamsfoundation.lams.tool.gmap.model.GmapAttachment; +import org.lamsfoundation.lams.tool.gmap.service.IGmapService; +import org.lamsfoundation.lams.tool.gmap.service.GmapServiceProxy; +import org.lamsfoundation.lams.tool.gmap.util.GmapConstants; +import org.lamsfoundation.lams.tool.gmap.web.forms.AuthoringForm; +import org.lamsfoundation.lams.util.FileValidatorUtil; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; + +/** + * @author + * @version + * + * @struts.action path="/authoring" name="authoringForm" parameter="dispatch" + * scope="request" validate="false" + * + * @struts.action-forward name="success" path="tiles:/authoring/main" + * @struts.action-forward name="message_page" path="tiles:/generic/message" + */ +public class AuthoringAction extends LamsDispatchAction { + + private static Logger logger = Logger.getLogger(AuthoringAction.class); + + public IGmapService gmapService; + + // Authoring SessionMap key names + private static final String KEY_TOOL_CONTENT_ID = "toolContentID"; + + private static final String KEY_CONTENT_FOLDER_ID = "contentFolderID"; + + private static final String KEY_MODE = "mode"; + + private static final String KEY_ONLINE_FILES = "onlineFiles"; + + private static final String KEY_OFFLINE_FILES = "offlineFiles"; + + private static final String KEY_UNSAVED_ONLINE_FILES = "unsavedOnlineFiles"; + + private static final String KEY_UNSAVED_OFFLINE_FILES = "unsavedOfflineFiles"; + + private static final String KEY_DELETED_FILES = "deletedFiles"; + + /** + * Default method when no dispatch parameter is specified. It is expected + * that the parametertoolContentID
will be passed in. This
+ * will be used to retrieve content for this tool.
+ *
+ */
+ protected ActionForward unspecified(ActionMapping mapping, ActionForm form,
+ HttpServletRequest request, HttpServletResponse response) {
+
+ // Extract toolContentID from parameters.
+ Long toolContentID = new Long(WebUtil.readLongParam(request,
+ AttributeNames.PARAM_TOOL_CONTENT_ID));
+
+ String contentFolderID = WebUtil.readStrParam(request,
+ AttributeNames.PARAM_CONTENT_FOLDER_ID);
+
+ ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, "mode",
+ true);
+
+ // set up gmapService
+ if (gmapService == null) {
+ gmapService = GmapServiceProxy.getGmapService(this
+ .getServlet().getServletContext());
+ }
+
+ // retrieving Gmap with given toolContentID
+ Gmap gmap = gmapService
+ .getGmapByContentId(toolContentID);
+ if (gmap == null) {
+ gmap = gmapService.copyDefaultContent(toolContentID);
+ gmap.setCreateDate(new Date());
+ gmapService.saveOrUpdateGmap(gmap);
+ // TODO NOTE: this causes DB orphans when LD not saved.
+ }
+
+ if (mode != null && mode.isTeacher()) {
+ // Set the defineLater flag so that learners cannot use content
+ // while we
+ // are editing. This flag is released when updateContent is called.
+ gmap.setDefineLater(true);
+ gmapService.saveOrUpdateGmap(gmap);
+ }
+
+ // Set up the authForm.
+ AuthoringForm authForm = (AuthoringForm) form;
+ updateAuthForm(authForm, gmap);
+
+ // Set up sessionMap
+ SessionMap
+
+
Copyright (C) 2006 LAMS Foundation (http://lamsfoundation.org
Index: lams_tool_gmap/web/common/header.jsp =================================================================== diff -u --- lams_tool_gmap/web/common/header.jsp (revision 0) +++ lams_tool_gmap/web/common/header.jsp (revision 3299d560146318cb6f26ec2b234e3af70ec21eba) @@ -0,0 +1,17 @@ +<%@ include file="/common/taglibs.jsp"%> + ++ ${requestScope.message}; +
Index: lams_tool_gmap/web/common/taglibs.jsp =================================================================== diff -u --- lams_tool_gmap/web/common/taglibs.jsp (revision 0) +++ lams_tool_gmap/web/common/taglibs.jsp (revision 3299d560146318cb6f26ec2b234e3af70ec21eba) @@ -0,0 +1,11 @@ +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%> + +<%@ taglib uri="tags-bean" prefix="bean"%> +<%@ taglib uri="tags-logic" prefix="logic"%> +<%@ taglib uri="tags-tiles" prefix="tiles"%> +<%@ taglib uri="tags-html" prefix="html"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="fck-editor" prefix="fck"%> + Index: lams_tool_gmap/web/error.jsp =================================================================== diff -u --- lams_tool_gmap/web/error.jsp (revision 0) +++ lams_tool_gmap/web/error.jsp (revision 3299d560146318cb6f26ec2b234e3af70ec21eba) @@ -0,0 +1,91 @@ +<%-- +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 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 +--%> + + + +<%@ page language="java" isErrorPage="true" pageEncoding="UTF-8" contentType="text/html;charset=utf-8"%> +<%@ taglib uri="tags-lams" prefix="lams"%> +<%@ taglib uri="tags-core" prefix="c"%> +<%@ taglib uri="tags-fmt" prefix="fmt"%> + +
+
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+ Edit
+ |
+
+
+
+ |
+
+ + | +
+
+
+
+ |
+
+ + |
+
+
+
+ |
+
+ + | +
+
+
+
+ |
+
+
+ +
++ ${user.firstName} ${user.lastName } + | +|
---|---|
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ ${gmapDTO.instructions} +
+ +
+
+
+ |
+
+ |
+
+ |
+
+ |
+
+
+ + ${userDTO.firstName} ${userDTO.lastName } ++ |
+ |
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ + | ++ + | +
+ |
+
+ |
+
+ + | ++ + | +
+ + ${session.sessionName} ++ |
+
+ |
+ + ${session.numberOfLearners} + | +
+ |
+ + ${session.numberOfFinishedLearners} + | +
+ + ${session.sessionName} ++ |
+
+ |
+ + ${session.numberOfLearners} + | +
+ |
+
+ |
+
---|---|
+ ${user.firstName} ${user.lastName} + | +
+ |
+