Index: lams_monitoring/conf/language/ApplicationResources.properties
===================================================================
diff -u -r568197820cd33d3fb1bab3ea4ec180a58800fd65 -r5be330617da306520389b76b1ebf51357dfdd8ad
--- lams_monitoring/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 568197820cd33d3fb1bab3ea4ec180a58800fd65)
+++ lams_monitoring/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 5be330617da306520389b76b1ebf51357dfdd8ad)
@@ -2,9 +2,16 @@
# Language strings for the Monitoring classes and screens. Mostly error messages.
label.synch.gate=Synch Gate
-label.permission.gate=Permission Gate
-label.schedule.gate=Schedule Gate
-lable.description=Description
+label.permission.gate.title=Permission Gate
+label.schedule.gate.title=Schedule Gate
+label.schedule.gate.open.message=Schedule Gate will be opened at:
+label.schedule.gate.close.message=Schedule Gate will be closed at:
+label.description=Description
+label.gate.you.open.message=Class cannot continue until the gate is opened by you
+label.gate.gate.open=Gate has been opened
+label.gate.open=open
+label.gate.close=close
+label.gate.waiting.learners={0} out of {1} are waiting in front of the gate.
#Page title for monitoring screen
monitor.title=Staff :: LAMS
@@ -25,4 +32,5 @@
# General system error message.
error.system.error=An error has occurred. Please start again. Reason for error: {0}
# User is not allowed to do whatever they just tried to do
-error.user.noprivilege=Sorry, you do not have the privilege to do this action.
\ No newline at end of file
+error.user.noprivilege=Sorry, you do not have the privilege to do this action.
+
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java
===================================================================
diff -u -r1454b2fd27486dd14b1ccf172b96df61a0b0d355 -r5be330617da306520389b76b1ebf51357dfdd8ad
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision 1454b2fd27486dd14b1ccf172b96df61a0b0d355)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java (.../MonitoringService.java) (revision 5be330617da306520389b76b1ebf51357dfdd8ad)
@@ -69,13 +69,11 @@
import org.lamsfoundation.lams.tool.exception.ToolException;
import org.lamsfoundation.lams.tool.service.ILamsCoreToolService;
import org.lamsfoundation.lams.usermanagement.Organisation;
-import org.lamsfoundation.lams.usermanagement.Role;
import org.lamsfoundation.lams.usermanagement.User;
import org.lamsfoundation.lams.usermanagement.WorkspaceFolder;
import org.lamsfoundation.lams.usermanagement.dao.IOrganisationDAO;
import org.lamsfoundation.lams.usermanagement.dao.IUserDAO;
import org.lamsfoundation.lams.usermanagement.dao.IWorkspaceFolderDAO;
-import org.lamsfoundation.lams.usermanagement.dto.OrganisationDTO;
import org.lamsfoundation.lams.usermanagement.exception.UserAccessDeniedException;
import org.lamsfoundation.lams.usermanagement.service.IUserManagementService;
import org.lamsfoundation.lams.util.Configuration;
Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java
===================================================================
diff -u -rd9c7ddef141d19423b6ab2914d153c2cb748f187 -r5be330617da306520389b76b1ebf51357dfdd8ad
--- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java (.../GateAction.java) (revision d9c7ddef141d19423b6ab2914d153c2cb748f187)
+++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java (.../GateAction.java) (revision 5be330617da306520389b76b1ebf51357dfdd8ad)
@@ -30,7 +30,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
@@ -47,6 +46,7 @@
import org.lamsfoundation.lams.monitoring.service.MonitoringServiceProxy;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.action.LamsDispatchAction;
+import org.lamsfoundation.lams.web.util.AttributeNames;
/**
@@ -91,7 +91,7 @@
//---------------------------------------------------------------------
// Instance variables
//---------------------------------------------------------------------
- private static Logger log = Logger.getLogger(GateAction.class);
+ // private static Logger log = Logger.getLogger(GateAction.class);
private IMonitoringService monitoringService;
private ILearnerService learnerService;
@@ -101,13 +101,10 @@
private static final String VIEW_SYNCH_GATE = "viewSynchGate";
private static final String VIEW_PERMISSION_GATE = "viewPermissionGate";
private static final String VIEW_SCHEDULE_GATE="viewScheduleGate";
+ private static final String ACTIVITY_FORM_FIELD = "activityId";
+ private static final String TOTAL_LEARNERS_FORM_FIELD = "totalLearners";
+
//---------------------------------------------------------------------
- // Class level constants - session attributes
- //---------------------------------------------------------------------
- private static final String PARAM_GATE_ACTIVITY_ID = "activityId";
- private static final String PARAM_LESSON_ID = "lessonId";
-
- //---------------------------------------------------------------------
// Struts Dispatch Method
//---------------------------------------------------------------------
/**
@@ -146,9 +143,14 @@
{
DynaActionForm gateForm = (DynaActionForm)form;
- long lessonId = WebUtil.readLongParam(request,PARAM_LESSON_ID);
-
- Long gateIdLong = (Long)gateForm.get("activityId");
+ long lessonId = WebUtil.readLongParam(request,AttributeNames.PARAM_LESSON_ID);
+
+ // if this is the initial call then activity id will be in the request, otherwise
+ // get it from the form (if being called from openGate.jsp
+ Long gateIdLong = WebUtil.readLongParam(request, AttributeNames.PARAM_ACTIVITY_ID, true);
+ if ( gateIdLong == null ) {
+ gateIdLong = (Long)gateForm.get(ACTIVITY_FORM_FIELD);
+ }
long gateId = gateIdLong != null ? gateIdLong.longValue() : -1 ;
this.monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext());
@@ -159,9 +161,9 @@
//setup the total learners
int totalLearners = LessonLearnerDataManager.getAllLessonLearners(getServlet().getServletContext(),lessonId,learnerService)
.size();
- gateForm.set("totalLearners",new Integer(totalLearners));
+ gateForm.set(TOTAL_LEARNERS_FORM_FIELD,new Integer(totalLearners));
+ gateForm.set(ACTIVITY_FORM_FIELD,gateIdLong);
-
return findViewByGateType(mapping, gateForm, gate);
}
/**
@@ -189,7 +191,7 @@
DynaActionForm gateForm = (DynaActionForm)form;
- GateActivity gate = monitoringService.openGate((Long)gateForm.get("activityId"));
+ GateActivity gate = monitoringService.openGate((Long)gateForm.get(ACTIVITY_FORM_FIELD));
return findViewByGateType(mapping, gateForm, gate);
}
@@ -213,16 +215,21 @@
Activity gate)
{
//dispatch the view according to the type of the gate.
- if(gate.isSynchGate())
- return viewSynchGate(mapping,gateForm,(SynchGateActivity)gate);
- else if(gate.isScheduleGate())
- return viewScheduleGate(mapping,gateForm,(ScheduleGateActivity)gate);
- else if(gate.isPermissionGate())
- return viewPermissionGate(mapping,gateForm,(PermissionGateActivity)gate);
- else
- throw new MonitoringServiceException("Invalid gate activity. " +
- "gate id ["+gate.getActivityId()+"] - the type ["+
- gate.getActivityTypeId()+"] is not a gate type");
+ if ( gate != null ) {
+ if(gate.isSynchGate())
+ return viewSynchGate(mapping,gateForm,(SynchGateActivity)gate);
+ else if(gate.isScheduleGate())
+ return viewScheduleGate(mapping,gateForm,(ScheduleGateActivity)gate);
+ else if(gate.isPermissionGate())
+ return viewPermissionGate(mapping,gateForm,(PermissionGateActivity)gate);
+ else
+ throw new MonitoringServiceException("Invalid gate activity. " +
+ "gate id ["+gate.getActivityId()+"] - the type ["+
+ gate.getActivityTypeId()+"] is not a gate type");
+ } else {
+ throw new MonitoringServiceException("Gate activity missing. " +
+ "gate id ["+gate.getActivityId()+"]");
+ }
}
Index: lams_monitoring/web/gate/gateInfo.jsp
===================================================================
diff -u -rd9c7ddef141d19423b6ab2914d153c2cb748f187 -r5be330617da306520389b76b1ebf51357dfdd8ad
--- lams_monitoring/web/gate/gateInfo.jsp (.../gateInfo.jsp) (revision d9c7ddef141d19423b6ab2914d153c2cb748f187)
+++ lams_monitoring/web/gate/gateInfo.jsp (.../gateInfo.jsp) (revision 5be330617da306520389b76b1ebf51357dfdd8ad)
@@ -21,7 +21,7 @@
-
+
|
@@ -33,7 +33,9 @@
- out of
- are waiting in front of the gate.
+
+
+
+
|
\ No newline at end of file
Index: lams_monitoring/web/gate/openGate.jsp
===================================================================
diff -u -rd9c7ddef141d19423b6ab2914d153c2cb748f187 -r5be330617da306520389b76b1ebf51357dfdd8ad
--- lams_monitoring/web/gate/openGate.jsp (.../openGate.jsp) (revision d9c7ddef141d19423b6ab2914d153c2cb748f187)
+++ lams_monitoring/web/gate/openGate.jsp (.../openGate.jsp) (revision 5be330617da306520389b76b1ebf51357dfdd8ad)
@@ -20,23 +20,23 @@
--%>
- Class cannot continue until the gate is opened by you |
+ |
- Gate has been opened
+
|
-  Active
+ 
-  Active
+ 
|
Index: lams_monitoring/web/gate/permissionGateContent.jsp
===================================================================
diff -u -rd9c7ddef141d19423b6ab2914d153c2cb748f187 -r5be330617da306520389b76b1ebf51357dfdd8ad
--- lams_monitoring/web/gate/permissionGateContent.jsp (.../permissionGateContent.jsp) (revision d9c7ddef141d19423b6ab2914d153c2cb748f187)
+++ lams_monitoring/web/gate/permissionGateContent.jsp (.../permissionGateContent.jsp) (revision 5be330617da306520389b76b1ebf51357dfdd8ad)
@@ -34,7 +34,7 @@
|
-
|
+
|
<%@ include file="gateInfo.jsp" %>
|
Index: lams_monitoring/web/gate/scheduleGateContent.jsp
===================================================================
diff -u -rd9c7ddef141d19423b6ab2914d153c2cb748f187 -r5be330617da306520389b76b1ebf51357dfdd8ad
--- lams_monitoring/web/gate/scheduleGateContent.jsp (.../scheduleGateContent.jsp) (revision d9c7ddef141d19423b6ab2914d153c2cb748f187)
+++ lams_monitoring/web/gate/scheduleGateContent.jsp (.../scheduleGateContent.jsp) (revision 5be330617da306520389b76b1ebf51357dfdd8ad)
@@ -33,19 +33,19 @@
|
-
|
+
|
<%@ include file="gateInfo.jsp" %>
|
|
- Schedule Gate will be opened at: |
+ |
|
- Schedule Gate will be closed at: |
+ |
|
Index: lams_monitoring/web/gate/sychGateContent.jsp
===================================================================
diff -u -rd9c7ddef141d19423b6ab2914d153c2cb748f187 -r5be330617da306520389b76b1ebf51357dfdd8ad
--- lams_monitoring/web/gate/sychGateContent.jsp (.../sychGateContent.jsp) (revision d9c7ddef141d19423b6ab2914d153c2cb748f187)
+++ lams_monitoring/web/gate/sychGateContent.jsp (.../sychGateContent.jsp) (revision 5be330617da306520389b76b1ebf51357dfdd8ad)
@@ -34,7 +34,7 @@
|
-
|
+
|
<%@ include file="gateInfo.jsp" %>
|