Index: lams_build/lib/lams/lams-central.jar
===================================================================
diff -u -re66bdae723516ab13d4a6f81e5f598018f6dbe58 -r00a6e145b37916eb1561ea5c68319b0fc691681b
Binary files differ
Index: lams_build/lib/lams/lams.jar
===================================================================
diff -u -re66bdae723516ab13d4a6f81e5f598018f6dbe58 -r00a6e145b37916eb1561ea5c68319b0fc691681b
Binary files differ
Index: lams_central/conf/language/lams/ApplicationResources.properties
===================================================================
diff -u -rc938db99e80a21d9099839105f58e9c7537fe0d5 -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision c938db99e80a21d9099839105f58e9c7537fe0d5)
+++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -256,5 +256,19 @@
label.planner.branch.default=(default)
label.planner.option=Option
+button.planner.editor.open=Open editor
+msg.planner.node.locked=This node is locked. You can not edit it.
+button.planner.save.node=Save node
+label.planner.create.subnode=Create subnode
+label.planner.edit.node=Edit node
+label.planner.root.node=Root
+msg.planner.open.template=This node opens 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)
+label.planner.description.full=Full description (for self)
+label.planner.root.choose=Choose a planner from one of the following activity categories:
+msg.planner.remove.warning=Are you sure you want to remove this node and all of its subnodes?
+
public.folder=Public Folder
#======= End labels: Exported 222 labels for en AU =====
Index: lams_central/conf/language/lams/ApplicationResources_en_AU.properties
===================================================================
diff -u -rc938db99e80a21d9099839105f58e9c7537fe0d5 -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_central/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision c938db99e80a21d9099839105f58e9c7537fe0d5)
+++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -256,5 +256,19 @@
label.planner.branch.default=(default)
label.planner.option=Option
+button.planner.editor.open=Open editor
+msg.planner.node.locked=This node is locked. You can not edit it.
+button.planner.save.node=Save node
+label.planner.create.subnode=Create subnode
+label.planner.edit.node=Edit node
+label.planner.root.node=Root
+msg.planner.open.template=This node opens 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)
+label.planner.description.full=Full description (for self)
+label.planner.root.choose=Choose a planner from one of the following activity categories:
+msg.planner.remove.warning=Are you sure you want to remove this node and all of its subnodes?
+
public.folder=Public Folder
#======= End labels: Exported 222 labels for en AU =====
Index: lams_central/conf/xdoclet/struts-forms.xml
===================================================================
diff -u -rc234c64ad9ff9d713f6d8e3331d0c20075e49303 -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_central/conf/xdoclet/struts-forms.xml (.../struts-forms.xml) (revision c234c64ad9ff9d713f6d8e3331d0c20075e49303)
+++ lams_central/conf/xdoclet/struts-forms.xml (.../struts-forms.xml) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -1,7 +1,11 @@
+
+
Fisheye: Tag 00a6e145b37916eb1561ea5c68319b0fc691681b refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/authoring/dto/PedagogicalPlannerActivityDTO.java'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 00a6e145b37916eb1561ea5c68319b0fc691681b refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/authoring/dto/PedagogicalPlannerDTO.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java
===================================================================
diff -u -rf4eb719e023dc891dc5fcf0dff63e0fe274e289e -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision f4eb719e023dc891dc5fcf0dff63e0fe274e289e)
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -78,6 +78,7 @@
import org.lamsfoundation.lams.lesson.service.ILessonService;
import org.lamsfoundation.lams.monitoring.service.IMonitoringService;
import org.lamsfoundation.lams.monitoring.service.MonitoringServiceException;
+import org.lamsfoundation.lams.planner.dao.PedagogicalPlannerDAO;
import org.lamsfoundation.lams.tool.SystemTool;
import org.lamsfoundation.lams.tool.Tool;
import org.lamsfoundation.lams.tool.ToolContentIDGenerator;
@@ -140,6 +141,8 @@
protected SystemToolDAO systemToolDAO;
+ protected PedagogicalPlannerDAO pedagogicalPlannerDAO;
+
protected ILamsCoreToolService lamsCoreToolService;
protected ILearningDesignService learningDesignService;
@@ -161,6 +164,14 @@
}
+ public PedagogicalPlannerDAO getPedagogicalPlannerDAO() {
+ return pedagogicalPlannerDAO;
+ }
+
+ public void setPedagogicalPlannerDAO(PedagogicalPlannerDAO pedagogicalPlannerDAO) {
+ this.pedagogicalPlannerDAO = pedagogicalPlannerDAO;
+ }
+
/*******************************************************************************************************************
* Setter Methods
******************************************************************************************************************/
@@ -527,8 +538,8 @@
}
if (design != null) { /*
- * only the user who is editing the design may unlock it
- */
+ * only the user who is editing the design may unlock it
+ */
if (design.getEditOverrideUser().equals(user)) {
design.setEditOverrideLock(false);
design.setEditOverrideUser(null);
@@ -1109,11 +1120,11 @@
if (oldParentActivities != null) {
Iterator iterator = oldParentActivities.iterator();
while (iterator.hasNext()) {
- processActivity((Activity) iterator.next(), newLearningDesign, newActivities, newGroupings, null,
- originalLearningDesign.getLearningDesignId(), uiidOffset, customCSV);
+ processActivity((Activity) iterator.next(), newLearningDesign, newActivities, newGroupings, null,
+ originalLearningDesign.getLearningDesignId(), uiidOffset, customCSV);
}
}
-
+
Collection activities = newActivities.values();
// Go back and find all the grouped activities and assign them the new
@@ -1131,68 +1142,68 @@
// and fix any branch mappings
for (Activity activity : activities) {
if (activity.isComplexActivity()) {
- ComplexActivity newComplex = (ComplexActivity) activity;
- Activity oldDefaultActivity = newComplex.getDefaultActivity();
- if (oldDefaultActivity != null) {
- Activity newDefaultActivity = newActivities.get(LearningDesign.addOffset(oldDefaultActivity
- .getActivityUIID(), uiidOffset));
- newComplex.setDefaultActivity(newDefaultActivity);
- }
+ ComplexActivity newComplex = (ComplexActivity) activity;
+ Activity oldDefaultActivity = newComplex.getDefaultActivity();
+ if (oldDefaultActivity != null) {
+ Activity newDefaultActivity = newActivities.get(LearningDesign.addOffset(oldDefaultActivity
+ .getActivityUIID(), uiidOffset));
+ newComplex.setDefaultActivity(newDefaultActivity);
+ }
}
if (activity.isSequenceActivity()) {
- SequenceActivity newSequenceActivity = (SequenceActivity) activity;
- // Need to check if the sets are not null as these are new
- // objects and Hibernate may not have backed them with
- // collections yet.
- if (newSequenceActivity.getBranchEntries() != null && newSequenceActivity.getBranchEntries().size() > 0) {
-
- Activity parentActivity = newSequenceActivity.getParentActivity();
- if (parentActivity.isChosenBranchingActivity() || parentActivity.isGroupBranchingActivity()
- && parentActivity.getDefineLater() != null
- && parentActivity.getDefineLater().booleanValue()) {
- // Don't have any preset up entries for a teacher chosen
- // or a define later group based branching.
- // Must be copying a design that was run previously.
- newSequenceActivity.getBranchEntries().clear();
-
- } else {
- Iterator beIter = newSequenceActivity.getBranchEntries().iterator();
- while (beIter.hasNext()) {
- // sequence activity will be correct but the
- // branching activity and the grouping will be wrong
- // the condition was copied by the sequence activity
- // copy
- BranchActivityEntry entry = (BranchActivityEntry) beIter.next();
- BranchingActivity oldBranchingActivity = (BranchingActivity) entry.getBranchingActivity();
- entry.setBranchingActivity(newActivities.get(LearningDesign.addOffset(oldBranchingActivity
- .getActivityUIID(), uiidOffset)));
- Group oldGroup = entry.getGroup();
- if (oldGroup != null) {
- Grouping oldGrouping = oldGroup.getGrouping();
- Grouping newGrouping = newGroupings.get(LearningDesign.addOffset(oldGrouping
- .getGroupingUIID(), uiidOffset));
- if (newGrouping != null) {
- entry.setGroup(newGrouping.getGroup(LearningDesign.addOffset(oldGroup
- .getGroupUIID(), uiidOffset)));
- }
- }
- }
-
+ SequenceActivity newSequenceActivity = (SequenceActivity) activity;
+ // Need to check if the sets are not null as these are new
+ // objects and Hibernate may not have backed them with
+ // collections yet.
+ if (newSequenceActivity.getBranchEntries() != null && newSequenceActivity.getBranchEntries().size() > 0) {
+
+ Activity parentActivity = newSequenceActivity.getParentActivity();
+ if (parentActivity.isChosenBranchingActivity() || parentActivity.isGroupBranchingActivity()
+ && parentActivity.getDefineLater() != null
+ && parentActivity.getDefineLater().booleanValue()) {
+ // Don't have any preset up entries for a teacher chosen
+ // or a define later group based branching.
+ // Must be copying a design that was run previously.
+ newSequenceActivity.getBranchEntries().clear();
+
+ } else {
+ Iterator beIter = newSequenceActivity.getBranchEntries().iterator();
+ while (beIter.hasNext()) {
+ // sequence activity will be correct but the
+ // branching activity and the grouping will be wrong
+ // the condition was copied by the sequence activity
+ // copy
+ BranchActivityEntry entry = (BranchActivityEntry) beIter.next();
+ BranchingActivity oldBranchingActivity = (BranchingActivity) entry.getBranchingActivity();
+ entry.setBranchingActivity(newActivities.get(LearningDesign.addOffset(oldBranchingActivity
+ .getActivityUIID(), uiidOffset)));
+ Group oldGroup = entry.getGroup();
+ if (oldGroup != null) {
+ Grouping oldGrouping = oldGroup.getGrouping();
+ Grouping newGrouping = newGroupings.get(LearningDesign.addOffset(oldGrouping
+ .getGroupingUIID(), uiidOffset));
+ if (newGrouping != null) {
+ entry.setGroup(newGrouping.getGroup(LearningDesign.addOffset(oldGroup
+ .getGroupUIID(), uiidOffset)));
+ }
}
}
+
+ }
+ }
}
if (activity.getInputActivities() != null && activity.getInputActivities().size() > 0) {
- Set newInputActivities = new HashSet();
- Iterator inputIter = activity.getInputActivities().iterator();
- while (inputIter.hasNext()) {
- Activity elem = (Activity) inputIter.next();
- newInputActivities.add(newActivities.get(LearningDesign.addOffset(elem.getActivityUIID(),
- uiidOffset)));
- }
- activity.getInputActivities().clear();
- activity.getInputActivities().addAll(newInputActivities);
+ Set newInputActivities = new HashSet();
+ Iterator inputIter = activity.getInputActivities().iterator();
+ while (inputIter.hasNext()) {
+ Activity elem = (Activity) inputIter.next();
+ newInputActivities.add(newActivities.get(LearningDesign.addOffset(elem.getActivityUIID(),
+ uiidOffset)));
+ }
+ activity.getInputActivities().clear();
+ activity.getInputActivities().addAll(newInputActivities);
}
}
@@ -1253,10 +1264,11 @@
newActivity.setParentActivity(parentActivity);
newActivity.setParentUIID(parentActivity.getActivityUIID());
}
-
- if(!(newActivity.isFloatingActivity() && newLearningDesign.getFloatingActivity() != null))
- newActivities.put(newActivity.getActivityUIID(), newActivity);
+ if (!(newActivity.isFloatingActivity() && newLearningDesign.getFloatingActivity() != null)) {
+ newActivities.put(newActivity.getActivityUIID(), newActivity);
+ }
+
if (newActivity.isToolActivity()) {
copyActivityToolContent(newActivity, newLearningDesign.getCopyTypeID(), originalLearningDesignId, customCSV);
}
@@ -1265,28 +1277,30 @@
if (oldChildActivities != null) {
Iterator childIterator = oldChildActivities.iterator();
while (childIterator.hasNext()) {
- Activity childActivity = (Activity) childIterator.next();
-
- // If Floating Activity(s) exist in BOTH designs then we:
- // Transfer the floating activities from the main design to the one that is to be imported.
- // Number of activities may overflow the max limit for the container - to be handled in flash
- // when design is opened.
- FloatingActivity fParentActivity = null;
- Activity refParentActivity = null;
-
- if(childActivity.isFloating() && newLearningDesign.getFloatingActivity() != null)
- fParentActivity = newLearningDesign.getFloatingActivity();
- else
- refParentActivity = newActivity;
-
- if(childActivity.isFloating() && fParentActivity != null)
- childActivity.setOrderId(fParentActivity.getActivities().size()+childActivity.getOrderId()+1);
-
- Activity pActivity = (fParentActivity != null) ? (Activity) fParentActivity : refParentActivity;
- processActivity(childActivity, newLearningDesign, newActivities, newGroupings,
- pActivity, originalLearningDesignId, uiidOffset, customCSV);
-
+ Activity childActivity = (Activity) childIterator.next();
+
+ // If Floating Activity(s) exist in BOTH designs then we:
+ // Transfer the floating activities from the main design to the one that is to be imported.
+ // Number of activities may overflow the max limit for the container - to be handled in flash
+ // when design is opened.
+ FloatingActivity fParentActivity = null;
+ Activity refParentActivity = null;
+
+ if (childActivity.isFloating() && newLearningDesign.getFloatingActivity() != null) {
+ fParentActivity = newLearningDesign.getFloatingActivity();
+ } else {
+ refParentActivity = newActivity;
}
+
+ if (childActivity.isFloating() && fParentActivity != null) {
+ childActivity.setOrderId(fParentActivity.getActivities().size() + childActivity.getOrderId() + 1);
+ }
+
+ Activity pActivity = fParentActivity != null ? (Activity) fParentActivity : refParentActivity;
+ processActivity(childActivity, newLearningDesign, newActivities, newGroupings, pActivity,
+ originalLearningDesignId, uiidOffset, customCSV);
+
+ }
}
}
Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java
===================================================================
diff -u -r05db875c7974d705f89231416ff6dfe91a5e70f1 -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java (.../IAuthoringService.java) (revision 05db875c7974d705f89231416ff6dfe91a5e70f1)
+++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/IAuthoringService.java (.../IAuthoringService.java) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -34,6 +34,7 @@
import org.lamsfoundation.lams.learningdesign.dto.AuthoringActivityDTO;
import org.lamsfoundation.lams.learningdesign.dto.ValidationErrorDTO;
import org.lamsfoundation.lams.learningdesign.exception.LearningDesignException;
+import org.lamsfoundation.lams.planner.dao.PedagogicalPlannerDAO;
import org.lamsfoundation.lams.usermanagement.User;
import org.lamsfoundation.lams.usermanagement.WorkspaceFolder;
import org.lamsfoundation.lams.usermanagement.exception.UserException;
@@ -389,4 +390,6 @@
public Grouping getGroupingById(Long groupingID);
+ public PedagogicalPlannerDAO getPedagogicalPlannerDAO();
+
}
Index: lams_central/src/java/org/lamsfoundation/lams/util/CentralConstants.java
===================================================================
diff -u -rc938db99e80a21d9099839105f58e9c7537fe0d5 -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_central/src/java/org/lamsfoundation/lams/util/CentralConstants.java (.../CentralConstants.java) (revision c938db99e80a21d9099839105f58e9c7537fe0d5)
+++ lams_central/src/java/org/lamsfoundation/lams/util/CentralConstants.java (.../CentralConstants.java) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -139,7 +139,7 @@
public static final String ERROR_PLANNER_TITLE_BLANK = "error.planner.title.blank";
- public static final String PATH_ACTIVITY_NO_PLANNER_SUPPORT = "/pedagogical_planner/defaultForm.jsp";
+ public static final String PATH_ACTIVITY_NO_PLANNER_SUPPORT = "/pedagogical_planner/defaultActivityForm.jsp";
public static final String TEMPLATE_FILE_NAME = "LAMS_Pedagogical_Planner_Template.zip";
Fisheye: Tag 00a6e145b37916eb1561ea5c68319b0fc691681b refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/web/planner/GroupingPedagogicalPlannerForm.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerAction.java
===================================================================
diff -u -rc938db99e80a21d9099839105f58e9c7537fe0d5 -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerAction.java (.../PedagogicalPlannerAction.java) (revision c938db99e80a21d9099839105f58e9c7537fe0d5)
+++ lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerAction.java (.../PedagogicalPlannerAction.java) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -40,8 +40,6 @@
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessages;
-import org.lamsfoundation.lams.authoring.dto.PedagogicalPlannerActivityDTO;
-import org.lamsfoundation.lams.authoring.dto.PedagogicalPlannerDTO;
import org.lamsfoundation.lams.authoring.service.IAuthoringService;
import org.lamsfoundation.lams.learningdesign.Activity;
import org.lamsfoundation.lams.learningdesign.BranchingActivity;
@@ -58,6 +56,11 @@
import org.lamsfoundation.lams.learningdesign.service.ImportToolContentException;
import org.lamsfoundation.lams.lesson.Lesson;
import org.lamsfoundation.lams.monitoring.service.IMonitoringService;
+import org.lamsfoundation.lams.planner.PedagogicalPlannerSequenceNode;
+import org.lamsfoundation.lams.planner.dao.PedagogicalPlannerDAO;
+import org.lamsfoundation.lams.planner.dto.PedagogicalPlannerActivityDTO;
+import org.lamsfoundation.lams.planner.dto.PedagogicalPlannerSequenceNodeDTO;
+import org.lamsfoundation.lams.planner.dto.PedagogicalPlannerTemplateDTO;
import org.lamsfoundation.lams.usermanagement.User;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
@@ -77,12 +80,14 @@
* @author Marcin Cieslak
*
* @struts:action path="/pedagogicalPlanner" scope="request" parameter="method"
- * @struts:action-forward name="success" path="/pedagogical_planner/base.jsp"
+ * name="PedagogicalPlannerSequenceNodeForm"
+ * @struts:action-forward name="template" path="/pedagogical_planner/templateBase.jsp"
*
- * @struts:action path="/pedagogicalPlanner/grouping" scope="request" name="GroupingPedagogicalPlannerForm"
+ * @struts:action path="/pedagogicalPlanner/grouping" scope="request" name="PedagogicalPlannerGroupingForm"
* validate="false" parameter="method"
* @struts:action-forward name="grouping" path="/pedagogical_planner/grouping.jsp"
* @struts:action-forward name="preview" path="/home.do?method=learner"
+ * @struts:action-forward name="sequenceChooser" path="/pedagogical_planner/sequenceChooser.jsp"
*/
public class PedagogicalPlannerAction extends LamsDispatchAction {
@@ -98,6 +103,7 @@
private static IAuthoringService authoringService;
private static IMonitoringService monitoringService;
private static MessageService messageService;
+ private static PedagogicalPlannerDAO pedagogicalPlannerDAO;
// Error messages used in class
private static final String ERROR_TOOL_ERRORS = "There were tool errors.";
@@ -119,7 +125,7 @@
*/
public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
- return start(mapping, form, request, response);
+ return openSequenceNode(mapping, form, request, response);
}
/**
@@ -133,8 +139,8 @@
* @throws IOException
* @throws ServletException
*/
- public ActionForward start(ActionMapping mapping, ActionForm form, HttpServletRequest request,
- HttpServletResponse response) throws IOException, ServletException {
+ private ActionForward openTemplate(ActionMapping mapping, HttpServletRequest request, String filePath)
+ throws IOException, ServletException {
// Get the learning design template zip file
String designFilePath = "pedagogical_planner" + File.separator + "1" + File.separator + "1" + File.separator
+ "1";
@@ -203,7 +209,7 @@
}
}
// create DTO for the whole design
- PedagogicalPlannerDTO planner = new PedagogicalPlannerDTO();
+ PedagogicalPlannerTemplateDTO planner = new PedagogicalPlannerTemplateDTO();
planner.setActivitySupportingPlannerCount(activitySupportingPlannerCount);
planner.setSequenceTitle(learningDesign.getTitle());
planner.setActivities(activities);
@@ -215,7 +221,7 @@
planner.setActivitiesInPortion(2);
request.setAttribute(CentralConstants.ATTR_PLANNER, planner);
- return mapping.findForward("success");
+ return mapping.findForward("template");
}
private IExportToolContentService getExportService() {
@@ -297,7 +303,7 @@
public ActionForward initGrouping(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
- GroupingPedagogicalPlannerForm plannerForm = (GroupingPedagogicalPlannerForm) form;
+ PedagogicalPlannerGroupingForm plannerForm = (PedagogicalPlannerGroupingForm) form;
Long groupingId = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID);
Grouping grouping = getAuthoringService().getGroupingById(groupingId);
plannerForm.fillForm(grouping);
@@ -306,7 +312,7 @@
public ActionForward saveOrUpdateGroupingForm(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
- GroupingPedagogicalPlannerForm plannerForm = (GroupingPedagogicalPlannerForm) form;
+ PedagogicalPlannerGroupingForm plannerForm = (PedagogicalPlannerGroupingForm) form;
ActionMessages errors = plannerForm.validate();
if (errors.isEmpty()) {
Grouping grouping = getAuthoringService().getGroupingById(plannerForm.getToolContentID());
@@ -481,7 +487,7 @@
short option = 1;
for (Activity nestedActivity : nestedActivities) {
// Currently Planner supports only 4 options, but there is no logical reason for that; just add
- // colours
+ // colours
// in CSS and change this value for additional options
if (option > CentralConstants.PLANNER_MAX_OPTIONS) {
throw new ServletException(PedagogicalPlannerAction.ERROR_TOO_MANY_OPTIONS);
@@ -518,4 +524,77 @@
}
return addedDTO;
}
+
+ public ActionForward openSequenceNode(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ Long nodeUid = WebUtil.readLongParam(request, "uid", true);
+ return openSequenceNode(mapping, request, nodeUid);
+ }
+
+ public ActionForward openSequenceNode(ActionMapping mapping, HttpServletRequest request, Long nodeUid)
+ throws IOException, ServletException {
+
+ PedagogicalPlannerSequenceNode node = null;
+ if (nodeUid == null) {
+ node = getPedagogicalPlannerDAO().getRootNode();
+ } else {
+ node = getPedagogicalPlannerDAO().getByUid(nodeUid);
+ if (node.getFileName() != null) {
+ String filePath = getPedagogicalPlannerDAO().getFilePath(node);
+ return openTemplate(mapping, request, filePath);
+ }
+ }
+ List titlePath = getPedagogicalPlannerDAO().getTitlePath(node);
+ PedagogicalPlannerSequenceNodeDTO dto = new PedagogicalPlannerSequenceNodeDTO(node, titlePath);
+
+ Boolean edit = WebUtil.readBooleanParam(request, "edit", false);
+ dto.setEdit(edit);
+
+ Boolean createSubnode = WebUtil.readBooleanParam(request, "createSubnode", false);
+ dto.setCreateSubnode(createSubnode);
+
+ request.setAttribute("node", dto);
+ return mapping.findForward("sequenceChooser");
+ }
+
+ public ActionForward saveSequenceNode(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ Long nodeUid = WebUtil.readLongParam(request, "uid", true);
+ PedagogicalPlannerSequenceNode node = null;
+ PedagogicalPlannerSequenceNodeForm nodeForm = (PedagogicalPlannerSequenceNodeForm) form;
+ if (nodeUid == null) {
+ node = new PedagogicalPlannerSequenceNode();
+ if (nodeForm.getParentUid() != null) {
+ PedagogicalPlannerSequenceNode parent = getPedagogicalPlannerDAO().getByUid(nodeForm.getParentUid());
+ node.setParent(parent);
+ }
+ node.setSubdir(getPedagogicalPlannerDAO().getNextSubdir(nodeForm.getParentUid()));
+ } else {
+ node = getPedagogicalPlannerDAO().getByUid(nodeUid);
+ }
+
+ node.setTitle(nodeForm.getTitle());
+ node.setBriefDescription(nodeForm.getBriefDescription());
+ node.setFullDescription(nodeForm.getFullDescription());
+ getPedagogicalPlannerDAO().saveOrUpdateNode(node);
+
+ nodeUid = node.getUid();
+ return openSequenceNode(mapping, request, nodeUid);
+ }
+
+ public ActionForward removeSequenceNode(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws IOException, ServletException {
+ Long nodeUid = WebUtil.readLongParam(request, "uid");
+ PedagogicalPlannerSequenceNode node = getPedagogicalPlannerDAO().getByUid(nodeUid);
+ Long parentUid = node.getParent() == null ? null : node.getParent().getUid();
+ getPedagogicalPlannerDAO().removeNode(node);
+ return openSequenceNode(mapping, request, parentUid);
+ }
+
+ public PedagogicalPlannerDAO getPedagogicalPlannerDAO() {
+ if (PedagogicalPlannerAction.pedagogicalPlannerDAO == null) {
+ PedagogicalPlannerAction.pedagogicalPlannerDAO = getAuthoringService().getPedagogicalPlannerDAO();
+ }
+ return PedagogicalPlannerAction.pedagogicalPlannerDAO;
+ }
}
\ No newline at end of file
Index: lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerActivityForm.java
===================================================================
diff -u
--- lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerActivityForm.java (revision 0)
+++ lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerActivityForm.java (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -0,0 +1,102 @@
+/****************************************************************
+ * 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$ */
+package org.lamsfoundation.lams.web.planner;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.struts.action.ActionForm;
+import org.apache.struts.action.ActionMapping;
+import org.apache.struts.action.ActionMessages;
+
+/**
+ * The base for any Pedagogical Planner Action Forms that other activities. All Java forms need to inherit from this
+ * class and forms on JSP pages need to have these properties declared as hidden elements.
+ *
+ * @author Marcin Cieslak
+ *
+ */
+public abstract class PedagogicalPlannerActivityForm extends ActionForm {
+ /**
+ * Set when opening a Learning Design.
+ */
+ private Integer activityOrderNumber;
+ private Long toolContentID;
+ /**
+ * Set in {@link #validate()} method.
+ */
+ private Boolean valid = true;
+ /**
+ * Set when submitting form in base.jsp page.
+ */
+ private Integer callID;
+
+ public Long getToolContentID() {
+ return toolContentID;
+ }
+
+ public void setToolContentID(Long toolContentID) {
+ this.toolContentID = toolContentID;
+ }
+
+ public Boolean getValid() {
+ return valid;
+ }
+
+ public void setValid(Boolean valid) {
+ this.valid = valid;
+ }
+
+ public Integer getCallID() {
+ return callID;
+ }
+
+ public void setCallID(Integer callID) {
+ this.callID = callID;
+ }
+
+ @Override
+ public void reset(ActionMapping mapping, HttpServletRequest request) {
+ super.reset(mapping, request);
+ setValid(true);
+ }
+
+ /**
+ * Validates form. Must set {@link #valid} property. Can be overriden by inheriting classes, although call to this
+ * method is only in activities themselves (and not on a higher level like lams_central).
+ *
+ * @return
+ */
+ public ActionMessages validate() {
+ setValid(true);
+ return new ActionMessages();
+ }
+
+ public Integer getActivityOrderNumber() {
+ return activityOrderNumber;
+ }
+
+ public void setActivityOrderNumber(Integer activityOrderNumber) {
+ this.activityOrderNumber = activityOrderNumber;
+ }
+}
\ No newline at end of file
Fisheye: Tag 00a6e145b37916eb1561ea5c68319b0fc691681b refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerForm.java'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerGroupingForm.java
===================================================================
diff -u
--- lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerGroupingForm.java (revision 0)
+++ lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerGroupingForm.java (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -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
+ * ****************************************************************
+ */
+
+/* $Id$ */
+package org.lamsfoundation.lams.web.planner;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.struts.action.ActionMessage;
+import org.apache.struts.action.ActionMessages;
+import org.lamsfoundation.lams.learningdesign.Grouping;
+import org.lamsfoundation.lams.learningdesign.LearnerChoiceGrouping;
+import org.lamsfoundation.lams.learningdesign.RandomGrouping;
+
+/**
+ * Form for grouping activities in Pedagogical Planner.
+ *
+ * @author Marcin Cieslak
+ *
+ */
+public class PedagogicalPlannerGroupingForm extends PedagogicalPlannerActivityForm {
+ private Integer groupingTypeId;
+ private String numberOfGroups;
+ private String learnersPerGroup;
+ private Boolean equalGroupSizes;
+
+ public Integer getGroupingTypeId() {
+ return groupingTypeId;
+ }
+
+ public void setGroupingTypeId(Integer groupingTypeId) {
+ this.groupingTypeId = groupingTypeId;
+ }
+
+ public String getNumberOfGroups() {
+ return numberOfGroups;
+ }
+
+ public void setNumberOfGroups(String numberOfGroups) {
+ this.numberOfGroups = numberOfGroups;
+ }
+
+ /**
+ * Fills the form properties with existing grouping object.
+ *
+ * @param grouping
+ * persistent object to use
+ */
+ public void fillForm(Grouping grouping) {
+ if (grouping != null) {
+ setGroupingTypeId(grouping.getGroupingTypeId());
+ if (grouping.isRandomGrouping()) {
+ RandomGrouping randomGrouping = (RandomGrouping) grouping;
+ String number = randomGrouping.getNumberOfGroups() == null ? null : String.valueOf(randomGrouping
+ .getNumberOfGroups());
+ setNumberOfGroups(number);
+
+ number = randomGrouping.getLearnersPerGroup() == null ? null : String.valueOf(randomGrouping
+ .getLearnersPerGroup());
+ setLearnersPerGroup(number);
+ } else if (grouping.isLearnerChoiceGrouping()) {
+ LearnerChoiceGrouping learnerChoiceGrouping = (LearnerChoiceGrouping) grouping;
+ String number = learnerChoiceGrouping.getNumberOfGroups() == null ? null : String
+ .valueOf(learnerChoiceGrouping.getNumberOfGroups());
+ setNumberOfGroups(number);
+
+ number = learnerChoiceGrouping.getLearnersPerGroup() == null ? null : String
+ .valueOf(learnerChoiceGrouping.getLearnersPerGroup());
+ setLearnersPerGroup(number);
+
+ setEqualGroupSizes(learnerChoiceGrouping.getEqualNumberOfLearnersPerGroup());
+ } else {
+ String numberOfGroups = grouping.getMaxNumberOfGroups() == null ? null : String.valueOf(grouping
+ .getMaxNumberOfGroups());
+ setNumberOfGroups(numberOfGroups);
+ }
+ }
+ }
+
+ /**
+ * Checks if the provided group/learner number is a nonnegative integer.
+ */
+ @Override
+ public ActionMessages validate() {
+ ActionMessages errors = new ActionMessages();
+ boolean valid = true;
+ boolean numberValid = true;
+
+ String numberToParse = StringUtils.isEmpty(getNumberOfGroups()) ? getLearnersPerGroup() : getNumberOfGroups();
+ try {
+ int number = Integer.parseInt(numberToParse);
+ if (number < 0) {
+ numberValid = false;
+ }
+ } catch (Exception e) {
+ numberValid = false;
+ }
+ if (!numberValid) {
+ errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.planner.grouping.number.integer"));
+ valid = false;
+ }
+ setValid(valid);
+ return errors;
+ }
+
+ public String getLearnersPerGroup() {
+ return learnersPerGroup;
+ }
+
+ public void setLearnersPerGroup(String numberOfLearners) {
+ learnersPerGroup = numberOfLearners;
+ }
+
+ public Boolean getEqualGroupSizes() {
+ return equalGroupSizes;
+ }
+
+ public void setEqualGroupSizes(Boolean equalGroupsSizes) {
+ equalGroupSizes = equalGroupsSizes;
+ }
+}
\ No newline at end of file
Index: lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerSequenceNodeForm.java
===================================================================
diff -u
--- lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerSequenceNodeForm.java (revision 0)
+++ lams_central/src/java/org/lamsfoundation/lams/web/planner/PedagogicalPlannerSequenceNodeForm.java (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -0,0 +1,74 @@
+/****************************************************************
+ * 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$ */
+package org.lamsfoundation.lams.web.planner;
+
+import org.apache.struts.action.ActionForm;
+
+public class PedagogicalPlannerSequenceNodeForm extends ActionForm {
+ private Long uid;
+ private Long parentUid;
+ private String title;
+ private String briefDescription;
+ private String fullDescription;
+
+ public Long getUid() {
+ return uid;
+ }
+
+ public void setUid(Long uid) {
+ this.uid = uid;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getBriefDescription() {
+ return briefDescription;
+ }
+
+ public void setBriefDescription(String briefDescription) {
+ this.briefDescription = briefDescription;
+ }
+
+ public String getFullDescription() {
+ return fullDescription;
+ }
+
+ public void setFullDescription(String fullDescription) {
+ this.fullDescription = fullDescription;
+ }
+
+ public Long getParentUid() {
+ return parentUid;
+ }
+
+ public void setParentUid(Long parentUid) {
+ this.parentUid = parentUid;
+ }
+}
\ No newline at end of file
Index: lams_central/web/includes/javascript/pedagogicalPlanner.js
===================================================================
diff -u -ra301da49ef54944c21a4c78c60a2637959be30b5 -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_central/web/includes/javascript/pedagogicalPlanner.js (.../pedagogicalPlanner.js) (revision a301da49ef54944c21a4c78c60a2637959be30b5)
+++ lams_central/web/includes/javascript/pedagogicalPlanner.js (.../pedagogicalPlanner.js) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -155,7 +155,26 @@
}
function closePlanner(text){
- if (confirm(text)){
- window.close();
+ if (text==null || confirm(text)){
+ window.close();
}
+ }
+
+ function leaveNodeEditor(text,url){
+ if (!isNodeChanged() || text==null || confirm(text)){
+ document.location.href=url;
+ }
+ }
+
+ function removeNode(text,url){
+ if (text==null || confirm(text)){
+ document.location.href=url;
+ }
+ }
+
+ function isNodeChanged(){
+ return false;
+ //title!=$("#title").val()
+ //|| briefDescription!=$("#briefDescription").val()
+ //|| fullDescription!=$("#fullDescription").val();
}
\ No newline at end of file
Fisheye: Tag 00a6e145b37916eb1561ea5c68319b0fc691681b refers to a dead (removed) revision in file `lams_central/web/pedagogical_planner/base.jsp'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_central/web/pedagogical_planner/defaultActivityForm.jsp
===================================================================
diff -u
--- lams_central/web/pedagogical_planner/defaultActivityForm.jsp (revision 0)
+++ lams_central/web/pedagogical_planner/defaultActivityForm.jsp (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -0,0 +1,27 @@
+
+
+<%-- Page that is displayed if activity does not support the pedagogical planner. --%>
+<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
+<%@ taglib uri="tags-lams" prefix="lams" %>
+<%@ taglib uri="tags-fmt" prefix="fmt" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+
+
+
+
+
+
+
+
+
+
+
+
+ ${param.formMessage}
+
+
+
+
+
+
\ No newline at end of file
Fisheye: Tag 00a6e145b37916eb1561ea5c68319b0fc691681b refers to a dead (removed) revision in file `lams_central/web/pedagogical_planner/defaultForm.jsp'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_central/web/pedagogical_planner/sequenceChooser.jsp
===================================================================
diff -u
--- lams_central/web/pedagogical_planner/sequenceChooser.jsp (revision 0)
+++ lams_central/web/pedagogical_planner/sequenceChooser.jsp (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -0,0 +1,215 @@
+
+
+<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
+<%@ taglib uri="tags-lams" prefix="lams" %>
+<%@ taglib uri="tags-fmt" prefix="fmt" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+<%@ taglib uri="tags-function" prefix="fn" %>
+<%@ taglib uri="tags-html" prefix="html" %>
+
+
+ ::
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%-- This part creates path like "> Root > Some node > Some subnode"
+ with links to upper level nodes --%>
+
+
+
+
+ <%-- Always add root node --%>
+ >
+ <%-- Iterate through subnodes, if any --%>
+
+
+
+
+
+
+ >
+
+
+
+ <%-- Title and full description of the node --%>
+
+
+
+
+
+
+
+ <%-- Main loop for activities --%>
+
+ <%-- Is it a simple, branching or options activity--%>
+
+
+
+
+
+
+
+
+
+ <%-- Small row with a down arrow --%>
+
+ <%-- If it's a break between two branches/options then don't draw neither an arrow nor colour --%>
+
+
+
+
+ <%-- If it's a beginning of a complex activity, write the title. --%>
+
+
+
+
+
${lastParentActivityTitle}
+
+
+
+ <%-- Row with activity frame --%>
+
+
+ ${complexActivityType} group${activity.group}
+
+
+ ${complexActivityType}LastActivity
+
+ ">
+ <%-- Write out number of the branch/option if any --%>
+
+
+
+ ${complexActivityType}LastActivity
+
+ ">
+ <%-- To get the contents, an Ajax call is made to the tool --%>
+
+ <%-- Editing advice link with URLs: one to check if it should be displayed (rel),
+ another one to get the contents (href) --%>
+
+
+
+
+
+
+
+
+
+ <%-- DIVs for messages from server, hidden by default --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ');">
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_common/build.xml
===================================================================
diff -u -r28d293ccf980c6d523173bfe4f9d58e2b99a1865 -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_common/build.xml (.../build.xml) (revision 28d293ccf980c6d523173bfe4f9d58e2b99a1865)
+++ lams_common/build.xml (.../build.xml) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -400,9 +400,9 @@
-
+
-
+
@@ -412,6 +412,8 @@
+
+
Index: lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/planner/PedagogicalPlannerSequenceNode.hbm.xml
===================================================================
diff -u
--- lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/planner/PedagogicalPlannerSequenceNode.hbm.xml (revision 0)
+++ lams_common/conf/hibernate/mappings/org/lamsfoundation/lams/planner/PedagogicalPlannerSequenceNode.hbm.xml (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_common/db/sql/create_lams_11_tables.sql
===================================================================
diff -u -rc2d2a9b8036e4bb9f3ff18ce70610c59fc6602d3 -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_common/db/sql/create_lams_11_tables.sql (.../create_lams_11_tables.sql) (revision c2d2a9b8036e4bb9f3ff18ce70610c59fc6602d3)
+++ lams_common/db/sql/create_lams_11_tables.sql (.../create_lams_11_tables.sql) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -1074,5 +1074,17 @@
, PRIMARY KEY (uid)
)TYPE=InnoDB;
-
-
\ No newline at end of file
+CREATE TABLE lams_planner_nodes (
+ uid BIGINT(20) NOT NULL auto_increment,
+ parent_uid BIGINT(20),
+ subdir TINYINT UNSIGNED NOT NULL,
+ locked TINYINT(1) NOT NULL DEFAULT 0,
+ title VARCHAR(255) NOT NULL,
+ brief_desc TEXT,
+ full_desc TEXT,
+ file_name VARCHAR(255),
+ PRIMARY KEY (uid),
+ UNIQUE KEY (parent_uid, subdir),
+ CONSTRAINT FK_lams_planner_node_parent FOREIGN KEY (parent_uid)
+ REFERENCES lams_planner_nodes(uid) ON DELETE CASCADE ON UPDATE CASCADE
+)TYPE=InnoDB;
\ No newline at end of file
Index: lams_common/db/sql/drop_lams_11_tables.sql
===================================================================
diff -u -r6e4ed3724bd76354c2ee43c88979385c4a162a0e -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_common/db/sql/drop_lams_11_tables.sql (.../drop_lams_11_tables.sql) (revision 6e4ed3724bd76354c2ee43c88979385c4a162a0e)
+++ lams_common/db/sql/drop_lams_11_tables.sql (.../drop_lams_11_tables.sql) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -37,6 +37,7 @@
DROP TABLE IF EXISTS lams_log_event_type;
DROP TABLE IF EXISTS lams_organisation;
DROP TABLE IF EXISTS lams_organisation_type;
+DROP TABLE IF EXISTS lams_planner_nodes;
DROP TABLE IF EXISTS lams_progress_attempted;
DROP TABLE IF EXISTS lams_progress_completed;
DROP TABLE IF EXISTS lams_role;
Index: lams_common/db/sql/insert_lams_windows_config_data.sql
===================================================================
diff -u -re5b1ceeabd291a569c4ca65bcfd78e497d38f1b4 -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_common/db/sql/insert_lams_windows_config_data.sql (.../insert_lams_windows_config_data.sql) (revision e5b1ceeabd291a569c4ca65bcfd78e497d38f1b4)
+++ lams_common/db/sql/insert_lams_windows_config_data.sql (.../insert_lams_windows_config_data.sql) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -14,7 +14,7 @@
values ('DumpDir','C:/lams/dump', 'config.dump.dir', 'config.header.system', 'STRING', 1);
insert into lams_configuration (config_key, config_value, description_key, header_name, format, required)
-values ('EARDir','C:/jboss-4.0.2/server/default/deploy/lams.ear', 'config.ear.dir', 'config.header.system', 'STRING', 1);
+values ('EARDir','D:/jboss-4.0.2/server/default/deploy/lams.ear', 'config.ear.dir', 'config.header.system', 'STRING', 1);
insert into lams_configuration (config_key, config_value, description_key, header_name, format, required)
values ('SMTPServer','', 'config.smtp.server', 'config.header.email', 'STRING', 0);
Index: lams_common/src/java/org/lamsfoundation/lams/commonContext.xml
===================================================================
diff -u -r28d293ccf980c6d523173bfe4f9d58e2b99a1865 -r00a6e145b37916eb1561ea5c68319b0fc691681b
--- lams_common/src/java/org/lamsfoundation/lams/commonContext.xml (.../commonContext.xml) (revision 28d293ccf980c6d523173bfe4f9d58e2b99a1865)
+++ lams_common/src/java/org/lamsfoundation/lams/commonContext.xml (.../commonContext.xml) (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -65,7 +65,7 @@
classpath:org/lamsfoundation/lams/notebook/model/NotebookEntry.hbm.xml
-
+
classpath:org/lamsfoundation/lams/events/Event.hbm.xmlclasspath:org/lamsfoundation/lams/events/Subscription.hbm.xml
@@ -78,6 +78,9 @@
classpath:org/lamsfoundation/lams/integration/ExtCourseClassMap.hbm.xmlclasspath:org/lamsfoundation/lams/integration/ExtUserUseridMap.hbm.xml
+
+ classpath:org/lamsfoundation/lams/planner/PedagogicalPlannerSequenceNode.hbm.xml
+
classpath*:org/lamsfoundation/lams/tool/**/*.hbm.xml
@@ -373,6 +376,11 @@
+
+
+
+
+
subnodes = new LinkedHashSet();
+ private Integer subdir;
+ private String title;
+ private String briefDescription;
+ private String fullDescription;
+ private String fileName;
+ private Boolean locked = false;
+
+ /**
+ * @hibernate.id column="uid" generator-class="native" type="java.lang.Long"
+ */
+ public Long getUid() {
+ return uid;
+ }
+
+ /**
+ * @hibernate.many-to-one column="parent_uid" cascade="save-update" foreign-key="FK_lams_planner_node_parent"
+ * @return
+ */
+ public PedagogicalPlannerSequenceNode getParent() {
+ return parent;
+ }
+
+ public void setParent(PedagogicalPlannerSequenceNode parent) {
+ this.parent = parent;
+ }
+
+ /**
+ * @hibernate.property column="subdir"
+ * @return
+ */
+ public Integer getSubdir() {
+ return subdir;
+ }
+
+ public void setSubdir(Integer subdir) {
+ this.subdir = subdir;
+ }
+
+ /**
+ * @hibernate.property column="title"
+ * @return
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ /**
+ * @hibernate.property column="brief_desc"
+ * @return
+ */
+ public String getBriefDescription() {
+ return briefDescription;
+ }
+
+ public void setBriefDescription(String briefDescription) {
+ this.briefDescription = briefDescription;
+ }
+
+ /**
+ * @hibernate.property column="full_desc"
+ * @return
+ */
+ public String getFullDescription() {
+ return fullDescription;
+ }
+
+ public void setFullDescription(String fullDescription) {
+ this.fullDescription = fullDescription;
+ }
+
+ /**
+ * @hibernate.property column="file_name"
+ * @return
+ */
+ public String getFileName() {
+ return fileName;
+ }
+
+ public void setFileName(String fileName) {
+ this.fileName = fileName;
+ }
+
+ private void setUid(Long uid) {
+ this.uid = uid;
+ }
+
+ /**
+ * @hibernate.set cascade="all" order-by="subdir asc"
+ * @hibernate.collection-key column="parent_uid"
+ * @hibernate.collection-one-to-many class="org.lamsfoundation.lams.planner.PedagogicalPlannerSequenceNode"
+ * @return
+ */
+ public Set getSubnodes() {
+ return subnodes;
+ }
+
+ public void setSubnodes(Set subnodes) {
+ this.subnodes = subnodes;
+ }
+
+ /**
+ * @hibernate.property column="locked"
+ * @return
+ */
+ public Boolean getLocked() {
+ return locked;
+ }
+
+ public void setLocked(Boolean locked) {
+ this.locked = locked;
+ }
+
+}
\ No newline at end of file
Index: lams_common/src/java/org/lamsfoundation/lams/planner/dao/PedagogicalPlannerDAO.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/planner/dao/PedagogicalPlannerDAO.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/planner/dao/PedagogicalPlannerDAO.java (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -0,0 +1,44 @@
+/****************************************************************
+ * 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$ */
+package org.lamsfoundation.lams.planner.dao;
+
+import java.util.List;
+
+import org.lamsfoundation.lams.planner.PedagogicalPlannerSequenceNode;
+
+public interface PedagogicalPlannerDAO {
+ PedagogicalPlannerSequenceNode getByUid(Long uid);
+
+ PedagogicalPlannerSequenceNode getRootNode();
+
+ void saveOrUpdateNode(PedagogicalPlannerSequenceNode node);
+
+ void removeNode(PedagogicalPlannerSequenceNode node);
+
+ List getTitlePath(PedagogicalPlannerSequenceNode node);
+
+ String getFilePath(PedagogicalPlannerSequenceNode node);
+
+ Integer getNextSubdir(Long parentUid);
+}
\ No newline at end of file
Index: lams_common/src/java/org/lamsfoundation/lams/planner/dao/hibernate/PedagogicalPlannerDAOHibernate.java
===================================================================
diff -u
--- lams_common/src/java/org/lamsfoundation/lams/planner/dao/hibernate/PedagogicalPlannerDAOHibernate.java (revision 0)
+++ lams_common/src/java/org/lamsfoundation/lams/planner/dao/hibernate/PedagogicalPlannerDAOHibernate.java (revision 00a6e145b37916eb1561ea5c68319b0fc691681b)
@@ -0,0 +1,137 @@
+/****************************************************************
+ * 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.planner.dao.hibernate;
+
+import java.io.File;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import org.lamsfoundation.lams.planner.PedagogicalPlannerSequenceNode;
+import org.lamsfoundation.lams.planner.dao.PedagogicalPlannerDAO;
+import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
+
+/**
+ *
+ * @author Marcin Cieslak
+ *
+ * @version $Revision$
+ */
+public class PedagogicalPlannerDAOHibernate extends HibernateDaoSupport implements PedagogicalPlannerDAO {
+ private static final String FIND_ROOT_NODE = "FROM " + PedagogicalPlannerSequenceNode.class.getName()
+ + " AS n WHERE n.parent=NULL";
+ private static final String FIND_PARENT_TITLE = "SELECT n.parent.uid, n.title FROM "
+ + PedagogicalPlannerSequenceNode.class.getName() + " AS n WHERE n.uid=?";
+
+ private static final String FIND_PARENT_DIR = "SELECT n.parent.uid, n.subdir FROM "
+ + PedagogicalPlannerSequenceNode.class.getName() + " AS n WHERE n.uid=?";
+
+ private static final String FIND_MAX_SUBDIR = "SELECT MAX(n.subdir) FROM "
+ + PedagogicalPlannerSequenceNode.class.getName() + " AS n WHERE n.parent.uid=?";
+
+ public PedagogicalPlannerSequenceNode getByUid(Long uid) {
+ return (PedagogicalPlannerSequenceNode) getHibernateTemplate().get(PedagogicalPlannerSequenceNode.class, uid);
+ }
+
+ public String getFilePath(PedagogicalPlannerSequenceNode node) {
+ if (node.getParent() == null) {
+ return null;
+ }
+ Long currentUid = node.getUid();
+ LinkedList filePathParts = new LinkedList();
+ List