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 NotebookException {
+ repositoryService = RepositoryProxy.getRepositoryService();
+ ICredentials credentials = new SimpleCredentials(
+ NotebookToolContentHandler.repositoryUser,
+ NotebookToolContentHandler.repositoryId);
+ try {
+ ITicket ticket = repositoryService.login(credentials,
+ NotebookToolContentHandler.repositoryWorkspaceName);
+ return ticket;
+ } catch (AccessDeniedException ae) {
+ throw new NotebookException("Access Denied to repository."
+ + ae.getMessage());
+ } catch (WorkspaceNotFoundException we) {
+ throw new NotebookException("Workspace not found." + we.getMessage());
+ } catch (LoginException e) {
+ throw new NotebookException("Login failed." + e.getMessage());
+ }
+ }
+
+ /* ********** Used by Spring to "inject" the linked objects ************* */
+
+ public INotebookAttachmentDAO getNotebookAttachmentDAO() {
+ return notebookAttachmentDAO;
+ }
+
+ public void setNotebookAttachmentDAO(INotebookAttachmentDAO attachmentDAO) {
+ this.notebookAttachmentDAO = attachmentDAO;
+ }
+
+ public INotebookDAO getNotebookDAO() {
+ return notebookDAO;
+ }
+
+ public void setNotebookDAO(INotebookDAO notebookDAO) {
+ this.notebookDAO = notebookDAO;
+ }
+
+ public IToolContentHandler getNotebookToolContentHandler() {
+ return notebookToolContentHandler;
+ }
+
+ public void setNotebookToolContentHandler(
+ IToolContentHandler notebookToolContentHandler) {
+ this.notebookToolContentHandler = notebookToolContentHandler;
+ }
+
+ public INotebookSessionDAO getNotebookSessionDAO() {
+ return notebookSessionDAO;
+ }
+
+ public void setNotebookSessionDAO(INotebookSessionDAO sessionDAO) {
+ this.notebookSessionDAO = sessionDAO;
+ }
+
+ public ILamsToolService getToolService() {
+ return toolService;
+ }
+
+ public void setToolService(ILamsToolService toolService) {
+ this.toolService = toolService;
+ }
+
+ public INotebookUserDAO getNotebookUserDAO() {
+ return notebookUserDAO;
+ }
+
+ public void setNotebookUserDAO(INotebookUserDAO userDAO) {
+ this.notebookUserDAO = 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;
+ }
+}
Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookToolServiceProxy.java
===================================================================
diff -u
--- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookToolServiceProxy.java (revision 0)
+++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookToolServiceProxy.java (revision 5948e17402e1ad574aeddbe55f93dca2f58bbbec)
@@ -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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ * USA
+ *
+ * http://www.gnu.org/licenses/gpl.txt
+ * ****************************************************************
+ */
+/* $$Id$$ */
+
+package org.lamsfoundation.lams.tool.notebook.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 NotebookToolServiceProxy { + + public static final INotebookToolService getNotebookToolService(ServletContext servletContext) + { + return (INotebookToolService)getNotebookDomainService(servletContext); + } + + private static Object getNotebookDomainService(ServletContext servletContext) + { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); + return wac.getBean("notebookToolService"); + } + + /* + * Return the notebook 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 getNotebookSessionManager(ServletContext servletContext) + { + return (ToolSessionManager)getNotebookDomainService(servletContext); + } + + + /* + * Return the notebook 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 getNotebookContentManager(ServletContext servletContext) + { + return (ToolContentManager)getNotebookDomainService(servletContext); + } + +} Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookConstants.java =================================================================== diff -u --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookConstants.java (revision 0) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookConstants.java (revision 5948e17402e1ad574aeddbe55f93dca2f58bbbec) @@ -0,0 +1,55 @@ +/**************************************************************** + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ + +package org.lamsfoundation.lams.tool.notebook.util; + +import java.util.LinkedList; + +import org.lamsfoundation.lams.tool.notebook.model.NotebookAttachment; + +public interface NotebookConstants { + public static final String TOOL_SIGNATURE = "lantbk11"; + + // Notebook 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_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookException.java =================================================================== diff -u --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookException.java (revision 0) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookException.java (revision 5948e17402e1ad574aeddbe55f93dca2f58bbbec) @@ -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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ + +package org.lamsfoundation.lams.tool.notebook.util; + +/** + * + * @author Anthony Sukkar + * + */ +public class NotebookException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = -5518806968051758859L; + + public NotebookException(String message) { + super(message); + } + + public NotebookException(String message, Throwable cause) { + super(message, cause); + } + + public NotebookException() { + super(); + + } + + public NotebookException(Throwable cause) { + super(cause); + + } + +} Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookToolContentHandler.java =================================================================== diff -u --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookToolContentHandler.java (revision 0) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/util/NotebookToolContentHandler.java (revision 5948e17402e1ad574aeddbe55f93dca2f58bbbec) @@ -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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ + +package org.lamsfoundation.lams.tool.notebook.util; + +import org.lamsfoundation.lams.contentrepository.client.ToolContentHandler; + +/** + * Simple client for accessing the content repository. + */ +public class NotebookToolContentHandler 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 = "notebookworkspace"; + + public static String repositoryUser = "notebook"; + + public static char[] repositoryId = { 'l', 'a', 'm', 's', '-', 'e', 'x' }; + + /** + * + */ + public NotebookToolContentHandler() { + 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_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java =================================================================== diff -u --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java (revision 0) +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/AuthoringAction.java (revision 5948e17402e1ad574aeddbe55f93dca2f58bbbec) @@ -0,0 +1,459 @@ +/**************************************************************** + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ +/* $$Id$$ */ + +package org.lamsfoundation.lams.tool.notebook.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.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.notebook.model.Notebook; +import org.lamsfoundation.lams.tool.notebook.model.NotebookAttachment; +import org.lamsfoundation.lams.tool.notebook.service.NotebookToolServiceProxy; +import org.lamsfoundation.lams.tool.notebook.service.INotebookToolService; +import org.lamsfoundation.lams.tool.notebook.util.NotebookConstants; +import org.lamsfoundation.lams.tool.notebook.web.forms.AuthoringForm; +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 INotebookToolService notebookToolService; + + // Authoring SessionMap key names + 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));
+
+ // set up notebookToolService
+ if (notebookToolService == null) {
+ notebookToolService = NotebookToolServiceProxy.getNotebookToolService(this.getServlet()
+ .getServletContext());
+ }
+
+ // retrieving Notebook with given toolContentID
+ Notebook notebook = notebookToolService.getNotebookByContentId(toolContentID);
+ if (notebook == null) {
+ notebook = notebookToolService.copyDefaultContent(toolContentID);
+ notebook.setCreateDate(new Date());
+ notebookToolService.saveOrUpdateNotebook(notebook);
+ // TODO NOTE: this causes DB orphans when LD not saved.
+ }
+
+ // check if content in use is set
+ if (notebook.getContentInUse()) {
+ // Cannot edit, send to message page.
+ request.setAttribute(NotebookConstants.ATTR_MESSAGE, getResources(
+ request).getMessage("error.content.locked"));
+ return mapping.findForward("message_page");
+ }
+
+ // Set the defineLater flag so that learners cannot use content while we
+ // are editing. This flag is released when updateContent is called.
+ notebook.setDefineLater(true);
+ notebookToolService.saveOrUpdateNotebook(notebook);
+
+ // Set up sessionMap
+ SessionMap map = new SessionMap();
+ initSessionMap(map, request);
+ updateSessionMap(map, notebook);
+
+ // Set up the authForm.
+ AuthoringForm authForm = (AuthoringForm) form;
+ updateAuthForm(authForm, notebook);
+
+ // add the sessionMapID to form
+ authForm.setSessionMapID(map.getSessionID());
+
+ // add the sessionMap to HTTPSession.
+ request.getSession().setAttribute(map.getSessionID(), map);
+
+ return mapping.findForward("success");
+ }
+
+ public ActionForward updateContent(ActionMapping mapping, ActionForm form,
+ HttpServletRequest request, HttpServletResponse response) {
+ // TODO need error checking.
+
+ // get authForm and session map.
+ AuthoringForm authForm = (AuthoringForm) form;
+ SessionMap map = getSessionMap(request, authForm);
+
+ // get notebook content.
+ Notebook notebook = notebookToolService.getNotebookByContentId(authForm.getToolContentID());
+
+ // update notebook content using form inputs.
+ updateNotebook(notebook, authForm);
+
+ // remove attachments marked for deletion.
+ Set attachments = notebook.getNotebookAttachments();
+ if (attachments == null) {
+ attachments = new HashSet();
+ }
+
+ for (NotebookAttachment att : getAttList(KEY_DELETED_FILES, map)) {
+ // remove from repository and db
+ notebookToolService.deleteFromRepository(att.getFileUuid(), att
+ .getFileVersionId());
+ attachments.remove(att);
+ }
+
+ // add unsaved attachments
+ attachments.addAll(getAttList(KEY_UNSAVED_ONLINE_FILES, map));
+ attachments.addAll(getAttList(KEY_UNSAVED_OFFLINE_FILES, map));
+
+ // set attachments in case it didn't exist
+ notebook.setNotebookAttachments(attachments);
+
+ // set the update date
+ notebook.setUpdateDate(new Date());
+
+ // releasing defineLater flag so that learner can start using the tool.
+ notebook.setDefineLater(false);
+
+ notebookToolService.saveOrUpdateNotebook(notebook);
+
+ request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG,
+ Boolean.TRUE);
+
+ // add the sessionMapID to form
+ authForm.setSessionMapID(map.getSessionID());
+
+ return mapping.findForward("success");
+ }
+
+ public ActionForward uploadOnline(ActionMapping mapping, ActionForm form,
+ HttpServletRequest request, HttpServletResponse response) {
+ return uploadFile(mapping, (AuthoringForm) form,
+ IToolContentHandler.TYPE_ONLINE, request);
+ }
+
+ public ActionForward uploadOffline(ActionMapping mapping, ActionForm form,
+ HttpServletRequest request, HttpServletResponse response) {
+ return uploadFile(mapping, (AuthoringForm) form,
+ IToolContentHandler.TYPE_OFFLINE, request);
+ }
+
+ public ActionForward deleteOnline(ActionMapping mapping, ActionForm form,
+ HttpServletRequest request, HttpServletResponse response) {
+ return deleteFile(mapping, (AuthoringForm) form,
+ IToolContentHandler.TYPE_ONLINE, request);
+ }
+
+ public ActionForward deleteOffline(ActionMapping mapping, ActionForm form,
+ HttpServletRequest request, HttpServletResponse response) {
+ return deleteFile(mapping, (AuthoringForm) form,
+ IToolContentHandler.TYPE_OFFLINE, request);
+ }
+
+ public ActionForward removeUnsavedOnline(ActionMapping mapping,
+ ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ return removeUnsaved(mapping, (AuthoringForm) form,
+ IToolContentHandler.TYPE_ONLINE, request);
+ }
+
+ public ActionForward removeUnsavedOffline(ActionMapping mapping,
+ ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+ return removeUnsaved(mapping, (AuthoringForm) form,
+ IToolContentHandler.TYPE_OFFLINE, request);
+ }
+
+ /* ========== Private Methods ********** */
+
+ private ActionForward uploadFile(ActionMapping mapping,
+ AuthoringForm authForm, String type, HttpServletRequest request) {
+ SessionMap map = getSessionMap(request, authForm);
+
+ FormFile file;
+ List
+
Copyright (C) 2006 LAMS Foundation (http://lamsfoundation.org
Index: lams_tool_notebook/web/common/header.jsp =================================================================== diff -u --- lams_tool_notebook/web/common/header.jsp (revision 0) +++ lams_tool_notebook/web/common/header.jsp (revision 5948e17402e1ad574aeddbe55f93dca2f58bbbec) @@ -0,0 +1,17 @@ +<%@ include file="/common/taglibs.jsp"%> + ++ ${requestScope.message}; +
\ No newline at end of file Index: lams_tool_notebook/web/common/taglibs.jsp =================================================================== diff -u --- lams_tool_notebook/web/common/taglibs.jsp (revision 0) +++ lams_tool_notebook/web/common/taglibs.jsp (revision 5948e17402e1ad574aeddbe55f93dca2f58bbbec) @@ -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"%> + \ No newline at end of file Index: lams_tool_notebook/web/images/edit.gif =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/images/error.png =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/images/error_big.png =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/images/exclude.png =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/images/exclude_big.png =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/images/good.png =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/images/good_big.png =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/images/hidden.png =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/images/hidden_big.png =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/images/icon_notebook.swf =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/images/success.gif =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/images/warning.png =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/images/warning_big.png =================================================================== diff -u Binary files differ Index: lams_tool_notebook/web/includes/javascript/xmlrequest.js =================================================================== diff -u --- lams_tool_notebook/web/includes/javascript/xmlrequest.js (revision 0) +++ lams_tool_notebook/web/includes/javascript/xmlrequest.js (revision 5948e17402e1ad574aeddbe55f93dca2f58bbbec) @@ -0,0 +1,56 @@ +// global request and XML document objects +var req; + +// retrieve XML document (reusable generic function); +// parameter is URL string (relative or complete) to +// an .xml file whose Content-Type is a valid XML +// type, such as text/xml; XML source must be from +// same domain as HTML file +function loadXMLDoc(url,target) { + // branch for native XMLHttpRequest object + if (window.XMLHttpRequest) { + req = new XMLHttpRequest(); + req.onreadystatechange = function(){ + processReqChange(target); + } + req.open("GET", url, true); + req.send(null); + // branch for IE/Windows ActiveX version + } else if (window.ActiveXObject) { + req = new ActiveXObject("Microsoft.XMLHTTP"); + if (req) { + req.onreadystatechange = function(){ + processReqChange(target); + } + req.open("GET", url, true); + req.send(); + } + } +} + + +// handle onreadystatechange event of req object +function processReqChange(target) { + // only if req shows "loaded" + if (req.readyState == 4) { + // only if "OK" + if (req.status == 200) { + var select = document.getElementById(target); + select.innerHTML = req.responseText; + } else { + alert("There was a problem retrieving the XML data:\n" + + req.statusText); + } + } +} +//main function, will call loadXMLDoc() directly, but catch any exception and alert. +function loadDoc(url,target) { + try { + loadXMLDoc(url, target); + } + catch(e) { + var msg = (typeof e == "string") ? e : ((e.message) ? e.message : "Unknown Error"); + alert("Unable to get XML data:\n" + msg); + return; + } +} \ No newline at end of file Index: lams_tool_notebook/web/layouts/defaultLayout.jsp =================================================================== diff -u --- lams_tool_notebook/web/layouts/defaultLayout.jsp (revision 0) +++ lams_tool_notebook/web/layouts/defaultLayout.jsp (revision 5948e17402e1ad574aeddbe55f93dca2f58bbbec) @@ -0,0 +1,22 @@ + + +<%@ include file="/common/taglibs.jsp"%> + + +
+ |
+
+ |
+
+ |
+
+ |
+
+ + | +
+ | + +
+
+
+ |
+
+ |
+
+ + | +
+ | + +
+
+
+ |
+
+
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+
+
+ |
+
+ |
+
+ + | ++ + | +
+ |
+
+ |
+
+ + | ++ + | +
+ ${session.sessionName} + | +|
---|---|
+ |
+ + ${session.numberOfLearners} + | +
+ |
+ + ${session.numberOfPosts} + | +
+ |
+
+ |
+
+ ${session.sessionName} + | +|
---|---|
+ |
+ + ${session.numberOfLearners} + | +
+ |
+ + ${session.numberOfPosts} + | +
+ |
+ + + | +
+
+
+
+ ${message.from} ${message.body}
+
+ + |
+