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 MindmapException {
+ ICredentials credentials = new SimpleCredentials(MindmapToolContentHandler.repositoryUser,
+ MindmapToolContentHandler.repositoryId);
+ try {
+ ITicket ticket = repositoryService.login(credentials, MindmapToolContentHandler.repositoryWorkspaceName);
+ return ticket;
+ } catch (AccessDeniedException ae) {
+ throw new MindmapException("Access Denied to repository." + ae.getMessage());
+ } catch (WorkspaceNotFoundException we) {
+ throw new MindmapException("Workspace not found." + we.getMessage());
+ } catch (LoginException e) {
+ throw new MindmapException("Login failed." + e.getMessage());
+ }
+ }
+
+ /* ===============Methods implemented from ToolContentImport102Manager =============== */
+
+ /**
+ * Import the data for a 1.0.2 Mindmap
+ */
+ public void import102ToolContent(Long toolContentId, UserDTO user, Hashtable importValues) {
+ Date now = new Date();
+ Mindmap mindmap = new Mindmap();
+ mindmap.setContentInUse(Boolean.FALSE);
+ mindmap.setCreateBy(new Long(user.getUserID().longValue()));
+ mindmap.setCreateDate(now);
+ mindmap.setDefineLater(Boolean.FALSE);
+ mindmap.setInstructions(WebUtil.convertNewlines((String) importValues.get(ToolContentImport102Manager.CONTENT_BODY)));
+ mindmap.setLockOnFinished(Boolean.TRUE);
+ mindmap.setOfflineInstructions(null);
+ mindmap.setOnlineInstructions(null);
+ mindmap.setRunOffline(Boolean.FALSE);
+ mindmap.setTitle((String) importValues.get(ToolContentImport102Manager.CONTENT_TITLE));
+ mindmap.setToolContentId(toolContentId);
+ mindmap.setUpdateDate(now);
+ //mindmap.setAllowRichEditor(Boolean.FALSE);
+ // leave as empty, no need to set them to anything.
+ // setMindmapAttachments(Set mindmapAttachments);
+ // setMindmapSessions(Set mindmapSessions);
+ mindmapDAO.saveOrUpdate(mindmap);
+ }
+
+ /** 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 {
+
+ MindmapService.logger
+ .warn("Setting the reflective field on a mindmap. This doesn't make sense as the mindmap is for reflection and we don't reflect on reflection!");
+ Mindmap mindmap = getMindmapByContentId(toolContentId);
+ if (mindmap == null) {
+ throw new DataMissingException("Unable to set reflective data titled " + title
+ + " on activity toolContentId " + toolContentId + " as the tool content does not exist.");
+ }
+
+ mindmap.setInstructions(description);
+ }
+
+ // =========================================================================================
+ /* Used by Spring to "inject" the linked objects */
+
+ public IRepositoryService getRepositoryService() {
+ return repositoryService;
+ }
+
+ public void setRepositoryService(IRepositoryService repositoryService) {
+ this.repositoryService = repositoryService;
+ }
+
+ public IMindmapAttachmentDAO getMindmapAttachmentDAO() {
+ return mindmapAttachmentDAO;
+ }
+
+ public void setMindmapAttachmentDAO(IMindmapAttachmentDAO attachmentDAO) {
+ mindmapAttachmentDAO = attachmentDAO;
+ }
+
+ public IMindmapDAO getMindmapDAO() {
+ return mindmapDAO;
+ }
+
+ public void setMindmapDAO(IMindmapDAO mindmapDAO) {
+ this.mindmapDAO = mindmapDAO;
+ }
+
+ public IToolContentHandler getMindmapToolContentHandler() {
+ return mindmapToolContentHandler;
+ }
+
+ public void setMindmapToolContentHandler(IToolContentHandler mindmapToolContentHandler) {
+ this.mindmapToolContentHandler = mindmapToolContentHandler;
+ }
+
+ public IMindmapSessionDAO getMindmapSessionDAO() {
+ return mindmapSessionDAO;
+ }
+
+ public void setMindmapSessionDAO(IMindmapSessionDAO sessionDAO) {
+ mindmapSessionDAO = sessionDAO;
+ }
+
+ public ILamsToolService getToolService() {
+ return toolService;
+ }
+
+ public void setToolService(ILamsToolService toolService) {
+ this.toolService = toolService;
+ }
+
+ public IMindmapUserDAO getMindmapUserDAO() {
+ return mindmapUserDAO;
+ }
+
+ public void setMindmapUserDAO(IMindmapUserDAO userDAO) {
+ mindmapUserDAO = 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;
+ }
+
+ public MindmapOutputFactory getMindmapOutputFactory() {
+ return mindmapOutputFactory;
+ }
+
+ public void setMindmapOutputFactory(MindmapOutputFactory mindmapOutputFactory) {
+ this.mindmapOutputFactory = mindmapOutputFactory;
+ }
+
+ public boolean isGroupedActivity(long toolContentID) {
+ return toolService.isGroupedActivity(toolContentID);
+ }
+
+ public void setMindmapNodeDAO(IMindmapNodeDAO mindmapNodeDAO) {
+ this.mindmapNodeDAO = mindmapNodeDAO;
+ }
+
+ public IMindmapNodeDAO getMindmapNodeDAO() {
+ return mindmapNodeDAO;
+ }
+
+ public void saveOrUpdateMindmapNode(MindmapNode mindmapNode) {
+ mindmapNodeDAO.saveOrUpdate(mindmapNode);
+ }
+
+ public List getAuthorRootNodeByMindmapId(Long mindmapId) {
+ return mindmapNodeDAO.getAuthorRootNodeByMindmapId(mindmapId);
+ }
+
+ public List getAuthorRootNodeByMindmapIdMulti(Long mindmapId) {
+ return mindmapNodeDAO.getAuthorRootNodeByMindmapIdMulti(mindmapId);
+ }
+
+ public List getRootNodeByMindmapIdAndUserId(Long mindmapId, Long userId) {
+ return mindmapNodeDAO.getRootNodeByMindmapIdAndUserId(mindmapId, userId);
+ }
+
+ public List getUserRootNodeByUserId(Long userId) {
+ return mindmapNodeDAO.getUserRootNodeByUserId(userId);
+ }
+
+ public List getMindmapNodeByParentId(Long parentId, Long mindmapId) {
+ return mindmapNodeDAO.getMindmapNodeByParentId(parentId, mindmapId);
+ }
+
+ public List getMindmapNodeByUniqueId(Long uniqueId, Long mindmapId) {
+ return mindmapNodeDAO.getMindmapNodeByUniqueId(uniqueId, mindmapId);
+ }
+
+ public List getMindmapNodeByUniqueIdMindmapIdUserId(Long uniqueId, Long mindmapId, Long userId) {
+ return mindmapNodeDAO.getMindmapNodeByUniqueIdMindmapIdUserId(uniqueId, mindmapId, userId);
+ }
+
+ public void deleteNodeByUniqueMindmapUser(Long uniqueId, Long mindmapId, Long userId) {
+ mindmapNodeDAO.deleteNodeByUniqueMindmapUser(uniqueId, mindmapId, userId);
+ }
+
+ public void deleteNodes(String nodesToDeleteCondition) {
+ mindmapNodeDAO.deleteNodes(nodesToDeleteCondition);
+ }
+
+ public String getNodesToDeleteCondition() {
+ return this.nodesToDeleteCondition;
+ }
+
+ public void setNodesToDeleteCondition(String nodesToDeleteCondition) {
+ this.nodesToDeleteCondition = nodesToDeleteCondition;
+ }
+
+ public Long getLastUniqueIdByMindmapIdUserId(Long mindmapId, Long userId) {
+ return this.mindmapNodeDAO.getLastUniqueIdByMindmapIdUserId(mindmapId, userId);
+ }
+
+ /**
+ * @param mindmapRequestDAO
+ * the mindmapRequestDAO to set
+ */
+ public void setMindmapRequestDAO(IMindmapRequestDAO mindmapRequestDAO) {
+ this.mindmapRequestDAO = mindmapRequestDAO;
+ }
+
+ /**
+ * @return mindmapRequestDAO
+ */
+ public IMindmapRequestDAO getMindmapRequestDAO() {
+ return mindmapRequestDAO;
+ }
+
+ public List getLastRequestsAfterGlobalId(Long globalId, Long mindmapId, Long userId) {
+ return mindmapRequestDAO.getLastRequestsAfterGlobalId(globalId, mindmapId, userId);
+ }
+
+ public MindmapRequest getRequestByUniqueId(Long uniqueId, Long userId, Long mindmapId, Long globalId) {
+ return mindmapRequestDAO.getRequestByUniqueId(uniqueId, userId, mindmapId, globalId);
+ }
+
+ /**
+ * @param mindmapMessageService
+ * @return mindmapRequestDAO.getLastGlobalIdByMindmapId(mindmapId)
+ */
+ public Long getLastGlobalIdByMindmapId(Long mindmapId) {
+ return mindmapRequestDAO.getLastGlobalIdByMindmapId(mindmapId);
+ }
+
+ /**
+ * @param mindmapMessageService
+ * @return mindmapNodeDAO.getLastUniqueIdByMindmapId(mindmapId)
+ */
+ public Long getLastUniqueIdByMindmapId(Long mindmapId) {
+ return mindmapNodeDAO.getLastUniqueIdByMindmapId(mindmapId);
+ }
+
+ /**
+ * @param mindmapMessageService
+ * @return
+ */
+ public void setMindmapMessageService(MessageService mindmapMessageService) {
+ this.mindmapMessageService = mindmapMessageService;
+ }
+
+ /**
+ * @return mindmapMessageService
+ */
+ public MessageService getMindmapMessageService() {
+ return mindmapMessageService;
+ }
+}
Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapServiceProxy.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapServiceProxy.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/service/MindmapServiceProxy.java 3 Apr 2009 00:00:33 -0000 1.1
@@ -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: MindmapServiceProxy.java,v 1.1 2009/04/03 00:00:33 ruslan Exp $$ */
+
+package org.lamsfoundation.lams.tool.mindmap.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 MindmapServiceProxy { + + public static final IMindmapService getMindmapService(ServletContext servletContext) + { + return (IMindmapService)getMindmapDomainService(servletContext); + } + + private static Object getMindmapDomainService(ServletContext servletContext) + { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); + return wac.getBean("mindmapService"); + } + + /* + * Return the mindmap 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 getMindmapSessionManager(ServletContext servletContext) + { + return (ToolSessionManager)getMindmapDomainService(servletContext); + } + + + /* + * Return the mindmap 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 getMindmapContentManager(ServletContext servletContext) + { + return (ToolContentManager)getMindmapDomainService(servletContext); + } + +} Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapConstants.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapConstants.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapConstants.java 3 Apr 2009 00:00:38 -0000 1.1 @@ -0,0 +1,63 @@ +/**************************************************************** + * 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: MindmapConstants.java,v 1.1 2009/04/03 00:00:38 ruslan Exp $$ */ + +package org.lamsfoundation.lams.tool.mindmap.util; + +public interface MindmapConstants { + public static final String TOOL_SIGNATURE = "lamind10"; + + // Mindmap 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 = "***"; + + public static final String ATTR_SESSION_MAP_ID = "sessionMapID"; + //public static final String ATTR_CONDITION_SET = "conditionList"; + + public static final String PARAM_ORDER_ID = "orderId"; + //public static final String ATTR_DELETED_CONDITION_LIST = "deletedConditionList"; + //public static final String TEXT_SEARCH_DEFINITION_NAME = "text.search.output.definition.mindmap"; + //public static final String TEXT_SEARCH_DEFAULT_CONDITION_DISPLAY_NAME_KEY = "text.search.output.definition.mindmap.default.condition"; + public static final String SUCCESS = "success"; + //public static final String ERROR_MSG_CONDITION = "error.condition"; + //public static final String ERROR_MSG_NAME_BLANK = "error.condition.name.blank"; + //public static final String ERROR_MSG_NAME_DUPLICATED = "error.condition.duplicated.name"; +} Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapException.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapException.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapException.java 3 Apr 2009 00:00:38 -0000 1.1 @@ -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: MindmapException.java,v 1.1 2009/04/03 00:00:38 ruslan Exp $$ */ + +package org.lamsfoundation.lams.tool.mindmap.util; + +/** + * + * @author Anthony Sukkar + * + */ +public class MindmapException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = -5518806968051758859L; + + public MindmapException(String message) { + super(message); + } + + public MindmapException(String message, Throwable cause) { + super(message, cause); + } + + public MindmapException() { + super(); + + } + + public MindmapException(Throwable cause) { + super(cause); + + } + +} Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapToolContentHandler.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapToolContentHandler.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/MindmapToolContentHandler.java 3 Apr 2009 00:00:38 -0000 1.1 @@ -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: MindmapToolContentHandler.java,v 1.1 2009/04/03 00:00:38 ruslan Exp $$ */ + +package org.lamsfoundation.lams.tool.mindmap.util; + +import org.lamsfoundation.lams.contentrepository.client.ToolContentHandler; + +/** + * Simple client for accessing the content repository. + */ +public class MindmapToolContentHandler 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 = "mindmapworkspace"; + + public static String repositoryUser = "mindmap"; + + public static char[] repositoryId = { 'l', 'a', 'm', 's', '-', 'e', 'x' }; + + /** + * + */ + public MindmapToolContentHandler() { + 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_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NodeConceptModel.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NodeConceptModel.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NodeConceptModel.java 3 Apr 2009 00:00:30 -0000 1.1 @@ -0,0 +1,139 @@ +/**************************************************************** + * 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 + * **************************************************************** + */ + +package org.lamsfoundation.lams.tool.mindmap.util.xmlmodel; + +/** + * XML Model Class for Mindmap Node Concept. Class includes data: + * Node ID, Text, Color, Creator(author of the node), and Edit(permitions to edit). + * + * @author Ruslan Kazakov + */ +public class NodeConceptModel { + private Long id; // Node ID + private String text; // Node Text + private String color; // Node color in Hex Format (i.e. ffffff) + private String creator; // Author of the Node + private int edit; // Permitions to edit node. Can be either 1 (editable) or 0 (not editable) + + /** Default Constructor */ + public NodeConceptModel() { + } + + /** Constructor without edit tag (for single-user mode) */ + public NodeConceptModel(Long id, String text, String color, String creator) { + this.setId(id); + this.setText(text); + this.setColor(color); + this.setCreator(creator); + } + + /** Full Constructor */ + public NodeConceptModel(Long id, String text, String color, String creator, int edit) { + this.setId(id); + this.setText(text); + this.setColor(color); + this.setCreator(creator); + this.setEdit(edit); + } + + /** + * Sets the id of the Node + * @param id + */ + public void setId(Long id) { + this.id = id; + } + + /** + * Returns the id of the Node + * @return id + */ + public Long getId() { + return id; + } + + /** + * Sets the text of the Node + * @param text + */ + public void setText(String text) { + this.text = text; + } + + /** + * Returns the text of the Node + * @return text + */ + public String getText() { + return text; + } + + /** + * Sets the color of the Node + * @param color + */ + public void setColor(String color) { + this.color = color; + } + + /** + * Returns the color of the Node + * @return color + */ + public String getColor() { + return color; + } + + /** + * Sets the author of the Node + * @param creator + */ + public void setCreator(String creator) { + this.creator = creator; + } + + /** + * Returns the author of the Node + * @return creator + */ + public String getCreator() { + return creator; + } + + /** + * Sets the state for the Node + * @param edit + */ + public void setEdit(int edit) { + this.edit = edit; + } + + /** + * Returns the state of the Node + * @return edit + */ + public int isEdit() { + return edit; + } +} Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NodeModel.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NodeModel.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/util/xmlmodel/NodeModel.java 3 Apr 2009 00:00:30 -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: NodeModel.java,v 1.1 2009/04/03 00:00:30 ruslan Exp $$ */ + +package org.lamsfoundation.lams.tool.mindmap.util.xmlmodel; + +import java.util.ArrayList; +import java.util.List; +import org.lamsfoundation.lams.tool.mindmap.util.xmlmodel.NodeConceptModel; + +/** + * XML Model Class for Mindmap Node + * + * @author Ruslan Kazakov + */ +public class NodeModel { + private NodeConceptModel concept; // Concept data + private ListtoolContentID
will be passed in. This will be used to retrieve content for this tool.
+ */
+ @Override
+ 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 mindmapService
+ if (mindmapService == null) {
+ mindmapService = MindmapServiceProxy.getMindmapService(this.getServlet().getServletContext());
+ }
+
+ // retrieving Mindmap with given toolContentID
+ Mindmap mindmap = mindmapService.getMindmapByContentId(toolContentID);
+ if (mindmap == null) {
+ mindmap = mindmapService.copyDefaultContent(toolContentID);
+ mindmap.setCreateDate(new Date());
+ mindmapService.saveOrUpdateMindmap(mindmap);
+ // TODO NOTE: this causes DB orphans when LD not saved.
+
+ // creating default nodes for current mindmap
+ String rootNodeName = mindmapService.getMindmapMessageService().getMessage("node.root.defaultName");
+ String childNodeName1 = mindmapService.getMindmapMessageService().getMessage("node.child1.defaultName");
+ String childNodeName2 = mindmapService.getMindmapMessageService().getMessage("node.child2.defaultName");
+
+ MindmapNode rootMindmapNode = mindmapService.saveMindmapNode(null, null, 1l, rootNodeName, "ffffff", null, mindmap);
+ mindmapService.saveOrUpdateMindmapNode(rootMindmapNode);
+ mindmapService.saveMindmapNode(null, rootMindmapNode, 2l, childNodeName1, "ffffff", null, mindmap);
+ mindmapService.saveMindmapNode(null, rootMindmapNode, 3l, childNodeName2, "ffffff", null, mindmap);
+ }
+
+ 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.
+ mindmap.setDefineLater(true);
+ mindmapService.saveOrUpdateMindmap(mindmap);
+ }
+
+ /* MINDMAP Code */
+
+ String mindmapContentPath = Configuration.get(ConfigurationKeys.SERVER_URL)
+ + "tool/lamind10/authoring.do?dispatch=setMindmapContent%26mindmapId=" + mindmap.getUid();
+ request.setAttribute("mindmapContentPath", mindmapContentPath);
+
+ String localizationPath = Configuration.get(ConfigurationKeys.SERVER_URL) +
+ "tool/lamind10/authoring.do?dispatch=setLocale";
+ request.setAttribute("localizationPath", localizationPath);
+
+ String currentMindmapUser = mindmapService.getMindmapMessageService().getMessage("node.instructor.label");
+ request.setAttribute("currentMindmapUser", currentMindmapUser);
+
+ String mindmapType = "images/mindmap_singleuser.swf";
+ request.setAttribute("mindmapType", mindmapType);
+
+ /* MINDMAP Code */
+
+ // Set up the authForm.
+ AuthoringForm authForm = (AuthoringForm) form;
+ updateAuthForm(authForm, mindmap);
+
+ // Set up sessionMap
+ SessionMap
+
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
Copyright (C) 2006 LAMS Foundation (http://lamsfoundation.org
Index: lams_tool_mindmap/web/common/header.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/web/common/header.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_mindmap/web/common/header.jsp 3 Apr 2009 00:00:33 -0000 1.1 @@ -0,0 +1,17 @@ +<%@ include file="/common/taglibs.jsp"%> + ++ ${requestScope.message}; +
Index: lams_tool_mindmap/web/common/messages.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/web/common/messages.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_tool_mindmap/web/common/messages.jsp 3 Apr 2009 00:00:33 -0000 1.1 @@ -0,0 +1,8 @@ +<%-- Error Messages --%> +
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+
+
+
+ |
+
+ + | +
+
+
+
+ |
+
+ + |
+
+
+
+ |
+
+ + | +
+
+
+
+ |
+
+
+ +
++ ${user.firstName} ${user.lastName } + | +|
---|---|
+ |
+
+
+
+ |
+
+ ${mindmapDTO.instructions} +
+ +
+
+
+
+
+ |
+
+ |
+
+ |
+
+ |
+
+
+
+
+
+
+ |
+ ||
+ |
+ ||
+ |
+
+
+ |
+
+
+ |
+
+ + |
+ ||
+
+
+
+
+ |
+ ||
+ |
+ ||
+ |
+
+
+ |
+
+
+ |
+
+ + ${userDTO.firstName} ${userDTO.lastName} ++ |
+ |
+ |
+
+
+
+ |
+
+ + ${session.sessionName} ++ |
+
+ |
+ + ${session.numberOfLearners} + | +
+ |
+ + ${session.numberOfFinishedLearners} + | +
+ |
+ + ${session.numberOfLearners} + | +
+ |
+
+ |
+
---|---|
+ ${user.firstName} ${user.lastName} + | +
+ |
+