Index: lams_tool_larsrc/conf/language/ApplicationResources.properties =================================================================== diff -u -r229b7cbba0b3121880c4dc69818e46d6589fd31e -r962368626dedf96b0d7c3bf5028905a97988356b --- lams_tool_larsrc/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 229b7cbba0b3121880c4dc69818e46d6589fd31e) +++ lams_tool_larsrc/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 962368626dedf96b0d7c3bf5028905a97988356b) @@ -115,6 +115,8 @@ #---------------------------------Monitoring ----------------------------------# monitoring.tab.summary=Summary monitoring.tab.statistics=Statistic +monitoring.tab.instructions=Instruction +monitoring.tab.edit.activity=Edit Activity monitoring.label.group=Group monitoring.summary.note=Note: number of learners is the number of learners who have viewed the resource. @@ -128,6 +130,10 @@ monitoring.label.user.name=Name monitoring.label.hidden=Hidden +label.monitoring.edit.activity.cancel =Cancel +label.monitoring.edit.activity.update =Update +label.monitoring.edit.activity.edit =Edit + message.monitoring.edit.activity.not.editable=This Activity is no longer editable #------------------------------End Monitoring ----------------------------------# export.label.resource=Resource Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/ResourceConstants.java =================================================================== diff -u -r00546fef27c802810d1b2ac3d621f9c3e2d64cb0 -r962368626dedf96b0d7c3bf5028905a97988356b --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/ResourceConstants.java (.../ResourceConstants.java) (revision 00546fef27c802810d1b2ac3d621f9c3e2d64cb0) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/ResourceConstants.java (.../ResourceConstants.java) (revision 962368626dedf96b0d7c3bf5028905a97988356b) @@ -75,7 +75,6 @@ public static final String ERROR_MSG_UPLOAD_FAILED = "error.upload.failed"; - + public static final String PAGE_EDITABLE = "isPageEditable"; - } Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/MonitoringAction.java =================================================================== diff -u -r00546fef27c802810d1b2ac3d621f9c3e2d64cb0 -r962368626dedf96b0d7c3bf5028905a97988356b --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 00546fef27c802810d1b2ac3d621f9c3e2d64cb0) +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/action/MonitoringAction.java (.../MonitoringAction.java) (revision 962368626dedf96b0d7c3bf5028905a97988356b) @@ -25,27 +25,33 @@ package org.lamsfoundation.lams.tool.rsrc.web.action; import java.io.IOException; -import java.util.ArrayList; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.log4j.Logger; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.rsrc.ResourceConstants; import org.lamsfoundation.lams.tool.rsrc.dto.Summary; +import org.lamsfoundation.lams.tool.rsrc.model.Resource; import org.lamsfoundation.lams.tool.rsrc.service.IResourceService; +import org.lamsfoundation.lams.tool.rsrc.service.ResourceApplicationException; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.util.AttributeNames; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; +import sun.util.logging.resources.logging; + public class MonitoringAction extends Action { + private static Logger log = Logger.getLogger(MonitoringAction.class); + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String param = mapping.getParameter(); @@ -121,6 +127,11 @@ //put it into HTTPSession request.getSession().setAttribute(ResourceConstants.ATTR_SUMMARY_LIST, groupList); + + Resource resource = service.getResourceByContentId(contentId); + request.getSession().setAttribute(ResourceConstants.PAGE_EDITABLE, new Boolean(isResourceEditable(resource))); + request.getSession().setAttribute(ResourceConstants.ATTR_RESOURCE, resource); + request.getSession().setAttribute(ResourceConstants.ATTR_TOOL_CONTENT_ID, contentId); return mapping.findForward(ResourceConstants.SUCCESS); } @@ -146,4 +157,19 @@ .getServletContext()); return (IResourceService) wac.getBean(ResourceConstants.RESOURCE_SERVICE); } + + private boolean isResourceEditable(Resource resource) { + if ( (resource.isDefineLater() == true) && (resource.isContentInUse()==true) ) + { +// throw new ResourceApplicationException("An exception has occurred: There is a bug in this tool, conflicting flags are set"); + log.error("An exception has occurred: There is a bug in this tool, conflicting flags are set"); + return false; + } + else if ( (resource.isDefineLater() == true) && (resource.isContentInUse() == false)) + return true; + else if ( (resource.isDefineLater() == false) && (resource.isContentInUse() == false)) + return true; + else // (content.isContentInUse()==true && content.isDefineLater() == false) + return false; + } } Index: lams_tool_larsrc/web/pages/monitoring/editactivity.jsp =================================================================== diff -u --- lams_tool_larsrc/web/pages/monitoring/editactivity.jsp (revision 0) +++ lams_tool_larsrc/web/pages/monitoring/editactivity.jsp (revision 962368626dedf96b0d7c3bf5028905a97988356b) @@ -0,0 +1,46 @@ +<%@ include file="/common/taglibs.jsp"%> + +
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+
+ |
+ |
+ + | + <%-- ++ + + | + --%> +|
+ |
+
+ |
+ |
+ + | + <%-- +
+
+
+ |
+ --%>
+ |
+ |
+