Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources.properties,v diff -u -r1.65 -r1.66 --- lams_central/conf/language/lams/ApplicationResources.properties 9 Mar 2009 18:58:00 -0000 1.65 +++ lams_central/conf/language/lams/ApplicationResources.properties 10 Mar 2009 23:12:10 -0000 1.66 @@ -240,7 +240,7 @@ error.planner.title.blank =Sequence title must not be blank. label.planner.not.supported =This activity does not support the planner. button.planner.save =Save template -button.planner.preview =Preview +label.planner.preview =Preview button.planner.view.full.author =View in Full Author label.planner.grouping.type=Group type @@ -264,7 +264,6 @@ label.planner.create.subnode=Create subnode label.planner.edit.node=Edit node label.planner.root.node=Planner -msg.planner.open.template=This node opens a planner template. msg.planner.remove.node=Remove node label.planner.empty.subnode=There are no subnodes defined. label.planner.description.brief=Brief description (for parent node) @@ -308,4 +307,8 @@ button.planner.template.close=Close editor msg.planner.editor.not.saved=Are you sure you want to close? If you have not saved the design, changes you have made will be lost and you will return to the previous node. + +label.planner.editor=Editor +msg.planner.preview=Open the template in lesson preview. +msg.planner.template.open=Open the template for editing. #======= End labels: Exported 222 labels for en AU ===== Index: lams_central/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources_en_AU.properties,v diff -u -r1.62 -r1.63 --- lams_central/conf/language/lams/ApplicationResources_en_AU.properties 9 Mar 2009 18:58:00 -0000 1.62 +++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties 10 Mar 2009 23:12:10 -0000 1.63 @@ -240,7 +240,7 @@ error.planner.title.blank =Sequence title must not be blank. label.planner.not.supported =This activity does not support the planner. button.planner.save =Save template -button.planner.preview =Preview +label.planner.preview =Preview button.planner.view.full.author =View in Full Author label.planner.grouping.type=Group type @@ -264,7 +264,6 @@ label.planner.create.subnode=Create subnode label.planner.edit.node=Edit node label.planner.root.node=Planner -msg.planner.open.template=This node opens a planner template. msg.planner.remove.node=Remove node label.planner.empty.subnode=There are no subnodes defined. label.planner.description.brief=Brief description (for parent node) @@ -306,7 +305,10 @@ label.planner.locked=(locked) label.planner.filter.find.location=Found in: - button.planner.template.close=Close editor msg.planner.editor.not.saved=Are you sure you want to close? If you have not saved the design, changes you have made will be lost and you will return to the previous node. + +label.planner.editor=Editor +msg.planner.preview=Open the template in lesson preview. +msg.planner.template.open=Open the template for editing. #======= End labels: Exported 222 labels for en AU ===== Index: lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerAction.java,v diff -u -r1.15 -r1.16 --- lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerAction.java 3 Mar 2009 15:49:24 -0000 1.15 +++ lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerAction.java 10 Mar 2009 23:12:10 -0000 1.16 @@ -34,11 +34,11 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.TreeMap; -import java.util.TreeSet; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; @@ -259,18 +259,19 @@ * @return * @throws ServletException */ - private ActionForward openTemplate(ActionMapping mapping, ActionForm form, HttpServletRequest request, - Long fileUuid, String fileName) throws ServletException { + public ActionForward openTemplate(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws ServletException { ActionMessages errors = new ActionMessages(); + Long nodeUid = WebUtil.readLongParam(request, CentralConstants.PARAM_UID); + PedagogicalPlannerSequenceNode node = getPedagogicalPlannerDAO().getByUid(nodeUid); // Open the learning design stored in the repository. - LearningDesign learningDesign = importLearningDesign(fileUuid, fileName, errors); + LearningDesign learningDesign = importLearningDesign(node.getFileUuid(), node.getFileName(), errors); if (!errors.isEmpty()) { saveErrors(request, errors); - // If anything goes wrong, open the root node. Errors will be displayed at top. - // This approach is used widely in this action. - return openSequenceNode(mapping, form, request, (Long) null); + // If anything goes wrong, errors will be displayed at top. This approach is used widely in this action. + return openSequenceNode(mapping, form, request, nodeUid); } List activities = new ArrayList(); @@ -294,7 +295,7 @@ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( PedagogicalPlannerAction.ERROR_KEY_LEARNING_DESIGN_COULD_NOT_BE_RETRIEVED)); saveErrors(request, errors); - return openSequenceNode(mapping, form, request, (Long) null); + return openSequenceNode(mapping, form, request, nodeUid); } // Recalculate how many activities actually support the planner @@ -590,10 +591,6 @@ node = getPedagogicalPlannerDAO().getRootNode(); } else { node = getPedagogicalPlannerDAO().getByUid(nodeUid); - if (!edit && node.getFileUuid() != null) { - // If we are not in the edit mode and we open a node containing a template, then we open the template - return openTemplate(mapping, form, request, node.getFileUuid(), node.getFileName()); - } } PedagogicalPlannerAction.log.debug("Opening sequence node with UID: " + nodeUid); @@ -607,7 +604,7 @@ if (filteredNodeUids != null) { request.setAttribute(CentralConstants.PARAM_FILTER_TEXT, filterText); - Set filteredNodes = new HashSet( + Set filteredNodes = new LinkedHashSet( filteredNodeUids.size()); for (Long filteredUid : filteredNodeUids) { PedagogicalPlannerSequenceNode subnode = getPedagogicalPlannerDAO().getByUid(filteredUid); @@ -653,20 +650,9 @@ if (createSubnode) { // We create a new node, rather than edit the existing one if (node.getContentFolderId() == null) { - try { - // If it's a new top level node, we create an uniuqe ID - String contentFolderId = FileUtil.generateUniqueContentFolderID(); - nodeForm.setContentFolderId(contentFolderId); - } catch (Exception e) { - PedagogicalPlannerAction.log.error(e, e); - dto.setEdit(false); - dto.setCreateSubnode(false); - ActionMessages errors = new ActionMessages(); - errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage( - PedagogicalPlannerAction.ERROR_KEY_EDITOR)); - saveErrors(request, errors); - return openSequenceNode(mapping, form, request, (Long) null); - } + // If it's a new top level node, we create an uniuqe ID + String contentFolderId = FileUtil.generateUniqueContentFolderID(); + nodeForm.setContentFolderId(contentFolderId); } else { // Whole node tree share the same content folder ID nodeForm.setContentFolderId(node.getContentFolderId()); @@ -729,6 +715,7 @@ try { node.setTitle(title); node.setBriefDescription(briefDescription); + node.setFullDescription(fullDescription); node.setContentFolderId(nodeForm.getContentFolderId()); // Different properties are set, depending on node type: with subnodes or template @@ -743,7 +730,6 @@ getContentHandler().deleteFile(node.getFileUuid()); node.setFileName(null); node.setFileUuid(null); - node.setFullDescription(null); } else if (nodeForm.getFile() != null && nodeForm.getFile().getFileSize() > 0) { FormFile file = nodeForm.getFile(); InputStream inputStream = file.getInputStream(); @@ -768,7 +754,6 @@ node.setFileUuid(nodeKey.getUuid()); node.setFileName(fileName); - node.setFullDescription(null); } getPedagogicalPlannerDAO().saveOrUpdateNode(node); @@ -1232,6 +1217,7 @@ if (node.getSubnodes() != null) { for (PedagogicalPlannerSequenceNode subnode : node.getSubnodes()) { importSubnodeTemplates(subnode, inputDir); + subnode.setParent(node); } } } else { @@ -1284,7 +1270,7 @@ */ private Set filterSubnodes(PedagogicalPlannerSequenceNode node, String filterText) throws ParseException, CorruptIndexException, IOException { - Set matchingSubnodeUids = new TreeSet(); + Set matchingSubnodeUids = new LinkedHashSet(); if (!StringUtils.isEmpty(filterText)) { Set docs = extractSubnodeDocuments(node); @@ -1336,6 +1322,7 @@ Document doc = new Document(); Field titleField = new Field(PedagogicalPlannerAction.FIELD_NAME_TITLE, subnode.getTitle(), Field.Store.NO, Field.Index.ANALYZED); + titleField.setBoost(10); doc.add(titleField); String briefDesc = WebUtil.removeHTMLtags(subnode.getBriefDescription()); Index: lams_central/web/includes/javascript/pedagogicalPlanner.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/includes/javascript/pedagogicalPlanner.js,v diff -u -r1.11 -r1.12 --- lams_central/web/includes/javascript/pedagogicalPlanner.js 28 Feb 2009 13:46:32 -0000 1.11 +++ lams_central/web/includes/javascript/pedagogicalPlanner.js 10 Mar 2009 23:12:10 -0000 1.12 @@ -175,15 +175,7 @@ } function onNodeTypeChange(){ - if (document.getElementById("hasSubnodesType").checked){ - document.getElementById("fileArea").style.display="none"; - document.getElementById("fullDescriptionArea").style.display="block"; - - } - else { - document.getElementById("fullDescriptionArea").style.display="none"; - document.getElementById("fileArea").style.display="block"; - } + document.getElementById("fileArea").style.display = document.getElementById("hasSubnodesType").checked ? "none" : "block"; } function filterNodes(url,doFilter){ Index: lams_central/web/pedagogical_planner/grouping.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/pedagogical_planner/Attic/grouping.jsp,v diff -u -r1.4 -r1.5 --- lams_central/web/pedagogical_planner/grouping.jsp 25 Feb 2009 18:23:39 -0000 1.4 +++ lams_central/web/pedagogical_planner/grouping.jsp 10 Mar 2009 23:12:10 -0000 1.5 @@ -42,7 +42,7 @@ - - - + + + + + <%-- Iterate through subnodes --%> @@ -134,58 +154,44 @@ <%-- Width is in percent, otherwise IE does not display it as desired --%>
+

Index: lams_central/web/pedagogical_planner/sequenceChooser.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/pedagogical_planner/Attic/sequenceChooser.jsp,v diff -u -r1.8 -r1.9 --- lams_central/web/pedagogical_planner/sequenceChooser.jsp 9 Mar 2009 18:58:00 -0000 1.8 +++ lams_central/web/pedagogical_planner/sequenceChooser.jsp 10 Mar 2009 23:12:10 -0000 1.9 @@ -20,7 +20,7 @@
- ${lamsFound} + <%-- We might need to alter that for RTL layout --%>

@@ -89,6 +89,24 @@

+ <%-- If we are not in the edit mode and the node leads to a template rather then subnodes, + we display links --%> + +
+ + + + + "> + + + + + "> +
+
${node.fullDescription}
@@ -121,11 +139,13 @@ <%-- If the list of subnodes is empty, we display only a message --%> -
-

-
+

+
<%-- Cell with icons (info or actions like remove node) --%> - - - - <%-- If we are in the edit mode (and not in filter mode), we display remove and move up/down images --%> - - + + + <%-- If we are in the edit mode (and not in filter mode), we display remove and move up/down images --%> + + + + + + + + + + + " + onclick="javascript:leaveNodeEditor('','${removeNodeUrl}')" /> + + + + " + onclick="javascript:leaveNodeEditor(null,'${upNodeUrl}')" /> + + - " - onclick="javascript:leaveNodeEditor('','${removeNodeUrl}')" /> - - - - - - - " - onclick="javascript:leaveNodeEditor(null,'${upNodeUrl}')" /> - - - - - - - - " - onclick="javascript:leaveNodeEditor(null,'${downNodeUrl}')" /> - + " + onclick="javascript:leaveNodeEditor(null,'${downNodeUrl}')" /> - - - <%-- If we are not in the edit mode and the node leads to a template rather then subnodes, - we display an icon --%> - - - - - - "> - - - + + <%-- Link to the subnode and its brief description below --%> @@ -199,7 +205,22 @@ - + +
+ + + + + "> + + + + + "> +
+
<%-- If we are in filter mode, we display the path where was the subnode found --%> @@ -245,7 +266,7 @@ - + " class="button" /> @@ -291,23 +312,15 @@ <%-- DIVs below are displayed/hidden depending of the subnode type: containing subnodes or opening a template --%> + +
+ + - - <%-- DIV with full description FCKeditor --%> -
- style="display: none;" - - > -
- - -
- <%-- DIV with "Browse" button to find the template --%>