Index: lams_monitoring/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rd5ff2e0121d67650eea6d972b04954a023cc3d4d -re8041fe8c578b86d6de23c35b0d7a4d2f42d08dd --- lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision d5ff2e0121d67650eea6d972b04954a023cc3d4d) +++ lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision e8041fe8c578b86d6de23c35b0d7a4d2f42d08dd) @@ -2,7 +2,7 @@ #language code: en #locale code: AU - # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Fri Oct 03 00:39:37 BST 2008 + # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Wed May 21 09:47:05 BST 2008 #=================== labels for Monitor (Java) =================# @@ -17,11 +17,16 @@ 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.gate.you.open.message =Class cannot continue until the gate is opened by you +label.gate.you.open.message =You may open the gate for the whole class label.gate.gate.open =Gate has been opened label.gate.open =Open label.gate.closed =Closed +label.gate.allow=Allow to pass label.gate.waiting.learners ={0} out of {1} are waiting in front of the gate. +label.gate.open.single.learner =You may allow a single learner to pass the gate +label.gate.list.all.learners=Forbidden to pass +label.gate.list.waiting.learners=Waiting in front of the gate +label.gate.list.allowed.learners=Allowed to pass label.grouping.max.num.in.group.heading =Maximum number of groups: label.grouping.general.instructions.line1 =Place the lesson participants in their groups. Initially you can add and remove users, but once the grouping is used (that is, a participant starts an activity that uses the grouping) you will not be able to remove users from groups. If you try to remove someone from a group and they will not remove check their progress - if they start using the group while you are on this screen you will not get any errors but you will not be able to remove them from their group. You will still be able to add users to groups. label.grouping.group.heading =Groups @@ -66,11 +71,9 @@ label.branching.non.allocated.groups.heading =Groups without a Branch label.branching.allocated.groups.heading =Groups of the selected Branch label.completed =Completed -label.grouping.general.instructions.heading =General Instructions: label.grouping.non.grouped.users.heading =Students without a Group label.branching.non.allocated.users.heading =Students without a Branch label.grouping.general.instructions.line2 =To create a group, type a group name and click Add Group. Repeat as required. Select a group, then select students from Column 2 and click Add selected to group. Select students in Column 3 and click Remove selected members from group to remove them from the group membership. The changes are saved when you click any of the buttons. -label.condtion.gate.title =Condition Gate - - -#======= End labels: Exported 65 labels for en AU ===== +label.grouping.general.instructions.heading =General Instructions: +label.condition.gate.title =Condition Gate +#======= End labels: Exported 64 labels for en AU ===== Index: lams_monitoring/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -rd5ff2e0121d67650eea6d972b04954a023cc3d4d -re8041fe8c578b86d6de23c35b0d7a4d2f42d08dd --- lams_monitoring/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision d5ff2e0121d67650eea6d972b04954a023cc3d4d) +++ lams_monitoring/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision e8041fe8c578b86d6de23c35b0d7a4d2f42d08dd) @@ -5,7 +5,6 @@ # CVS ID: $Id$ Exported from the LAMS Community by Ernie Ghiglione on Fri Oct 03 00:39:37 BST 2008 #=================== labels for Monitor (Java) =================# - message.activity.parallel.noFrames =Your browser does not handle frames! label.started =Started label.not.started =Not Started @@ -17,11 +16,16 @@ 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.gate.you.open.message =Class cannot continue until the gate is opened by you +label.gate.you.open.message =You may open the gate for the whole class label.gate.gate.open =Gate has been opened label.gate.open =Open label.gate.closed =Closed +label.gate.allow=Allow to pass label.gate.waiting.learners ={0} out of {1} are waiting in front of the gate. +label.gate.open.single.learner =You may allow a single learner to pass the gate +label.gate.list.all.learners=Forbidden to pass +label.gate.list.waiting.learners=Waiting in front of the gate +label.gate.list.allowed.learners=Allowed to pass label.grouping.max.num.in.group.heading =Maximum number of groups: label.grouping.general.instructions.line1 =Place the lesson participants in their groups. Initially you can add and remove users, but once the grouping is used (that is, a participant starts an activity that uses the grouping) you will not be able to remove users from groups. If you try to remove someone from a group and they will not remove check their progress - if they start using the group while you are on this screen you will not get any errors but you will not be able to remove them from their group. You will still be able to add users to groups. label.grouping.group.heading =Groups @@ -66,11 +70,11 @@ label.branching.non.allocated.groups.heading =Groups without a Branch label.branching.allocated.groups.heading =Groups of the selected Branch label.completed =Completed -label.grouping.general.instructions.heading =General Instructions: label.grouping.non.grouped.users.heading =Students without a Group label.branching.non.allocated.users.heading =Students without a Branch label.grouping.general.instructions.line2 =To create a group, type a group name and click Add Group. Repeat as required. Select a group, then select students from Column 2 and click Add selected to group. Select students in Column 3 and click Remove selected members from group to remove them from the group membership. The changes are saved when you click any of the buttons. -label.condtion.gate.title =Condition Gate +label.grouping.general.instructions.heading =General Instructions: +label.condition.gate.title =Condition Gate #======= End labels: Exported 65 labels for en AU ===== Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java =================================================================== diff -u -r209087915bc219f430c282ad00e5d1e6462f9b5f -re8041fe8c578b86d6de23c35b0d7a4d2f42d08dd --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java (.../GateAction.java) (revision 209087915bc219f430c282ad00e5d1e6462f9b5f) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GateAction.java (.../GateAction.java) (revision e8041fe8c578b86d6de23c35b0d7a4d2f42d08dd) @@ -48,255 +48,261 @@ import org.lamsfoundation.lams.web.util.AttributeNames; /** - *

The action servlet that allows the teacher to view the status of sync - * gate, scheduling gate and permission gate. The teacher can also force the - * gate to open through this servlet.

+ *

+ * The action servlet that allows the teacher to view the status of sync gate, scheduling gate and permission gate. The + * teacher can also force the gate to open through this servlet. + *

* - *

Regarding view gate status, followings contents should be shown by - * calling this action servlet: - *

  • 1.View the status of an sync gate, the lams should show how many - * learners are waiting and the size of the total class.
  • - *
  • 2.View the status of the permission gate, the lams shows the number - * of the learners waiting in front of the gates.
  • - *
  • 3.View the status of the schedule gate, the lams shows the gate - * status. If the schedule has been triggerred. The teacher should - * be able to change the trigger.
  • + *

    + * Regarding view gate status, followings contents should be shown by calling this action servlet: + *

  • 1.View the status of an sync gate, the lams should show how many learners are waiting and the size of the total + * class.
  • + *
  • 2.View the status of the permission gate, the lams shows the number of the learners waiting in front of the + * gates.
  • + *
  • 3.View the status of the schedule gate, the lams shows the gate status. If the schedule has been triggerred. The + * teacher should be able to change the trigger.
  • *

    * * @author Jacky Fang - * @since 2005-4-15 + * @since 2005-4-15 * @version 1.1 * * ----------------XDoclet Tags-------------------- * - * @struts:action name="GateForm" - * path="/gate" - * parameter="method" - * scope="session" - * validate="false" + * @struts:action name="GateForm" path="/gate" parameter="method" scope="session" validate="false" * @struts:action-forward name="viewSynchGate" path=".viewSynchGate" * @struts:action-forward name="viewPermissionGate" path=".viewPermissionGate" * @struts:action-forward name="viewScheduleGate" path=".viewScheduleGate" - * ----------------XDoclet Tags-------------------- + * @struts:action-forward name="viewConditionGate" path=".viewConditionGate" ----------------XDoclet + * Tags-------------------- * */ public class GateAction extends LamsDispatchAction { - //--------------------------------------------------------------------- - // Instance variables - //--------------------------------------------------------------------- - // private static Logger log = Logger.getLogger(GateAction.class); + // --------------------------------------------------------------------- + // Instance variables + // --------------------------------------------------------------------- + // private static Logger log = Logger.getLogger(GateAction.class); - private IMonitoringService monitoringService; - private ICoreLearnerService learnerService; - //--------------------------------------------------------------------- - // Class level constants - Struts forward - //--------------------------------------------------------------------- - 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 VIEW_CONDITION_GATE = "viewConditionGate"; + private IMonitoringService monitoringService; + private ICoreLearnerService learnerService; + // --------------------------------------------------------------------- + // Class level constants - Struts forward + // --------------------------------------------------------------------- + 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 VIEW_CONDITION_GATE = "viewConditionGate"; - // Gate Form fields - private static final String ACTIVITY_FORM_FIELD = "activityId"; - private static final String TOTAL_LEARNERS_FORM_FIELD = "totalLearners"; - public static final String READ_ONLY = "readOnly"; - public static final String LOCAL_FILES = "localFiles"; - private static final String USER_ID = "userId"; + // Gate Form fields + private static final String ACTIVITY_FORM_FIELD = "activityId"; + private static final String TOTAL_LEARNERS_FORM_FIELD = "totalLearners"; + public static final String READ_ONLY = "readOnly"; + public static final String LOCAL_FILES = "localFiles"; + private static final String USER_ID = "userId"; - //--------------------------------------------------------------------- - // Struts Dispatch Method - //--------------------------------------------------------------------- - /** - *

    The dispatch method that allows the teacher to view the status of the - * gate. It is expecting the caller passed in lesson id and gate activity - * id as http parameter. Otherwise, the utility method will generate some - * exception.

    - * - *

    Based on the lesson id and gate activity id, it sets up the gate form - * to show the waiting learners and the total waiting learners. Regarding - * schedule gate, it also shows the estimated gate opening time and gate - * closing time.

    - * - * Note: gate form attribute waitingLearners got setup - * after the view is dispatch to ensure there won't be casting exception - * occur if the activity id is not a gate by chance. - * - * - * @param mapping An ActionMapping class that will be used by the Action - * class to tell the ActionServlet where to send the end-user. - * - * @param form The ActionForm class that will contain any data submitted - * by the end-user via a form. - * @param request A standard Servlet HttpServletRequest class. - * @param response A standard Servlet HttpServletResponse class. - * @return An ActionForward class that will be returned to the ActionServlet - * indicating where the user is to go next. - * @throws IOException - * @throws ServletException - */ - public ActionForward viewGate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException { - DynaActionForm gateForm = (DynaActionForm) form; + // --------------------------------------------------------------------- + // Struts Dispatch Method + // --------------------------------------------------------------------- + /** + *

    + * The dispatch method that allows the teacher to view the status of the gate. It is expecting the caller passed in + * lesson id and gate activity id as http parameter. Otherwise, the utility method will generate some exception. + *

    + * + *

    + * Based on the lesson id and gate activity id, it sets up the gate form to show the waiting learners and the total + * waiting learners. Regarding schedule gate, it also shows the estimated gate opening time and gate closing time. + *

    + * + * Note: gate form attribute waitingLearners got setup after the view is dispatch to ensure + * there won't be casting exception occur if the activity id is not a gate by chance. + * + * + * @param mapping + * An ActionMapping class that will be used by the Action class to tell the ActionServlet where to + * send the end-user. + * + * @param form + * The ActionForm class that will contain any data submitted by the end-user via a form. + * @param request + * A standard Servlet HttpServletRequest class. + * @param response + * A standard Servlet HttpServletResponse class. + * @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go + * next. + * @throws IOException + * @throws ServletException + */ + public ActionForward viewGate(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + DynaActionForm gateForm = (DynaActionForm) form; - // 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(GateAction.ACTIVITY_FORM_FIELD); - } - long gateId = gateIdLong != null ? gateIdLong.longValue() : -1; + // 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(GateAction.ACTIVITY_FORM_FIELD); + } + long gateId = gateIdLong != null ? gateIdLong.longValue() : -1; - monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); - learnerService = MonitoringServiceProxy.getLearnerService(getServlet().getServletContext()); + monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); + learnerService = MonitoringServiceProxy.getLearnerService(getServlet().getServletContext()); - GateActivity gate = (GateActivity) monitoringService.getActivityById(gateId); + GateActivity gate = (GateActivity) monitoringService.getActivityById(gateId); - if (gate == null) { - throw new MonitoringServiceException("Gate activity missing. Activity id" + gateId); - } + if (gate == null) { + throw new MonitoringServiceException("Gate activity missing. Activity id" + gateId); + } - //setup the total learners - int totalLearners = learnerService.getLearnersForGate(gate).size(); - gateForm.set(GateAction.TOTAL_LEARNERS_FORM_FIELD, new Integer(totalLearners)); - gateForm.set(GateAction.ACTIVITY_FORM_FIELD, gateIdLong); - gateForm.set(GateAction.LOCAL_FILES, Boolean.FALSE); + // setup the total learners + int totalLearners = learnerService.getLearnersForGate(gate).size(); + gateForm.set(GateAction.TOTAL_LEARNERS_FORM_FIELD, new Integer(totalLearners)); + gateForm.set(GateAction.ACTIVITY_FORM_FIELD, gateIdLong); + gateForm.set(GateAction.LOCAL_FILES, Boolean.FALSE); - return findViewByGateType(mapping, gateForm, gate); - } + return findViewByGateType(mapping, gateForm, gate); + } - /** - * Open the gate if is closed. - * - * @param mapping An ActionMapping class that will be used by the Action - * class to tell the ActionServlet where to send the end-user. - * - * @param form The ActionForm class that will contain any data submitted - * by the end-user via a form. - * @param request A standard Servlet HttpServletRequest class. - * @param response A standard Servlet HttpServletResponse class. - * @return An ActionForward class that will be returned to the ActionServlet - * indicating where the user is to go next. - * @throws IOException - * @throws ServletException - */ - public ActionForward openGate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException { - monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); + /** + * Open the gate if is closed. + * + * @param mapping + * An ActionMapping class that will be used by the Action class to tell the ActionServlet where to + * send the end-user. + * + * @param form + * The ActionForm class that will contain any data submitted by the end-user via a form. + * @param request + * A standard Servlet HttpServletRequest class. + * @param response + * A standard Servlet HttpServletResponse class. + * @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go + * next. + * @throws IOException + * @throws ServletException + */ + public ActionForward openGate(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); - DynaActionForm gateForm = (DynaActionForm) form; + DynaActionForm gateForm = (DynaActionForm) form; - GateActivity gate = monitoringService.openGate((Long) gateForm.get(GateAction.ACTIVITY_FORM_FIELD)); + GateActivity gate = monitoringService.openGate((Long) gateForm.get(GateAction.ACTIVITY_FORM_FIELD)); - return findViewByGateType(mapping, gateForm, gate); - } + return findViewByGateType(mapping, gateForm, gate); + } - /** - * Allows a single learner to pass the gate. - * @param mapping An ActionMapping class that will be used by the Action - * class to tell the ActionServlet where to send the end-user. - * @param form he ActionForm class that will contain any data submitted - * by the end-user via a form. - * @param request A standard Servlet HttpServletRequest class. - * @param response A standard Servlet HttpServletRequest class. - * @return An ActionForward class that will be returned to the ActionServlet - * indicating where the user is to go next. - * @throws IOException - * @throws ServletException - */ - public ActionForward openGateForSingleUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { - monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); + /** + * Allows a single learner to pass the gate. + * + * @param mapping + * An ActionMapping class that will be used by the Action class to tell the ActionServlet where to + * send the end-user. + * @param form + * he ActionForm class that will contain any data submitted by the end-user via a form. + * @param request + * A standard Servlet HttpServletRequest class. + * @param response + * A standard Servlet HttpServletRequest class. + * @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go + * next. + * @throws IOException + * @throws ServletException + */ + public ActionForward openGateForSingleUser(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + monitoringService = MonitoringServiceProxy.getMonitoringService(getServlet().getServletContext()); - DynaActionForm gateForm = (DynaActionForm) form; - Long gateIdLong = (Long) gateForm.get(GateAction.ACTIVITY_FORM_FIELD); - Integer userId = (Integer) gateForm.get(GateAction.USER_ID); - GateActivity gate = monitoringService.openGateForSingleUser(gateIdLong, userId); - return findViewByGateType(mapping, gateForm, gate); - } + DynaActionForm gateForm = (DynaActionForm) form; + Long gateIdLong = (Long) gateForm.get(GateAction.ACTIVITY_FORM_FIELD); + Integer userId = (Integer) gateForm.get(GateAction.USER_ID); + GateActivity gate = monitoringService.openGateForSingleUser(gateIdLong, userId); + return findViewByGateType(mapping, gateForm, gate); + } - /** - * Export Portfolio Page - */ - public ActionForward exportPortfolio(ActionMapping mapping, ActionForm form, HttpServletRequest request, - HttpServletResponse response) throws IOException, ServletException { - DynaActionForm gateForm = (DynaActionForm) form; - ActionForward forward = viewGate(mapping, form, request, response); - gateForm.set(GateAction.READ_ONLY, Boolean.TRUE); - gateForm.set(GateAction.LOCAL_FILES, Boolean.TRUE); - return forward; - } + /** + * Export Portfolio Page + */ + public ActionForward exportPortfolio(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) throws IOException, ServletException { + DynaActionForm gateForm = (DynaActionForm) form; + ActionForward forward = viewGate(mapping, form, request, response); + gateForm.set(GateAction.READ_ONLY, Boolean.TRUE); + gateForm.set(GateAction.LOCAL_FILES, Boolean.TRUE); + return forward; + } - //--------------------------------------------------------------------- - // Helper Methods - //--------------------------------------------------------------------- - /** - * Dispatch view the according to the gate type. - * - * @param mapping An ActionMapping class that will be used by the Action - * class to tell the ActionServlet where to send the end-user. - * @param gateForm The ActionForm class that will contain any data submitted - * by the end-user via a form. - * @param permissionGate the gate acitivty object - * @return An ActionForward class that will be returned to the ActionServlet - * indicating where the user is to go next. - */ - private ActionForward findViewByGateType(ActionMapping mapping, DynaActionForm gateForm, GateActivity gate) { - // reset all the other fields, so that the following code only has to set up its own values (LDEV-1237) - gateForm.set(GateAction.READ_ONLY, Boolean.FALSE); - gateForm.set("gate", null); - gateForm.set("waitingLearners", null); - gateForm.set("waitingLearnerList", null); - gateForm.set("allowedToPassLearnerList", null); - gateForm.set("forbiddenLearnerList", null); - gateForm.set("startingTime", null); - gateForm.set("endingTime", null); + // --------------------------------------------------------------------- + // Helper Methods + // --------------------------------------------------------------------- + /** + * Dispatch view the according to the gate type. + * + * @param mapping + * An ActionMapping class that will be used by the Action class to tell the ActionServlet where to + * send the end-user. + * @param gateForm + * The ActionForm class that will contain any data submitted by the end-user via a form. + * @param permissionGate + * the gate acitivty object + * @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go + * next. + */ + private ActionForward findViewByGateType(ActionMapping mapping, DynaActionForm gateForm, GateActivity gate) { + // reset all the other fields, so that the following code only has to set up its own values (LDEV-1237) + gateForm.set(GateAction.READ_ONLY, Boolean.FALSE); + gateForm.set("gate", null); + gateForm.set("waitingLearners", null); + gateForm.set("waitingLearnerList", null); + gateForm.set("allowedToPassLearnerList", null); + gateForm.set("forbiddenLearnerList", null); + gateForm.set("startingTime", null); + gateForm.set("endingTime", null); - Set waitingLearnersList = gate.getWaitingLearners(); - gateForm.set("gate", gate); - gateForm.set("waitingLearners", new Integer(waitingLearnersList.size())); + Set waitingLearnersList = gate.getWaitingLearners(); + gateForm.set("gate", gate); + gateForm.set("waitingLearners", new Integer(waitingLearnersList.size())); - //dispatch the view according to the type of the gate. - if (gate.isSynchGate()) { - return mapping.findForward(GateAction.VIEW_SYNCH_GATE); - } - else if (gate.isScheduleGate()) { - return viewScheduleGate(mapping, gateForm, (ScheduleGateActivity) gate); - } - else if (gate.isConditionGate()) { - gateForm.set("allowedToPassLearnerList", gate.getAllowedToPassLearners()); - gateForm.set(GateAction.READ_ONLY, Boolean.TRUE); - return mapping.findForward(GateAction.VIEW_CONDITION_GATE); - } - else if (gate.isPermissionGate() || gate.isSystemGate()) { - gateForm.set("waitingLearnerList", waitingLearnersList); - gateForm.set("allowedToPassLearnerList", gate.getAllowedToPassLearners()); - Collection forbiddenUsers = learnerService.getLearnersForGate(gate); - forbiddenUsers.removeAll(gate.getAllowedToPassLearners()); - gateForm.set("forbiddenLearnerList", forbiddenUsers); - return mapping.findForward(GateAction.VIEW_PERMISSION_GATE); - } - else { - throw new MonitoringServiceException("Invalid gate activity. " + "gate id [" + gate.getActivityId() - + "] - the type [" + gate.getActivityTypeId() + "] is not a gate type"); - } + // dispatch the view according to the type of the gate. + if (gate.isSynchGate()) { + return mapping.findForward(GateAction.VIEW_SYNCH_GATE); + } else if (gate.isScheduleGate()) { + return viewScheduleGate(mapping, gateForm, (ScheduleGateActivity) gate); + } else if (gate.isConditionGate()) { + gateForm.set("allowedToPassLearnerList", gate.getAllowedToPassLearners()); + gateForm.set(GateAction.READ_ONLY, Boolean.TRUE); + return mapping.findForward(GateAction.VIEW_CONDITION_GATE); + } else if (gate.isPermissionGate() || gate.isSystemGate()) { + gateForm.set("waitingLearnerList", waitingLearnersList); + gateForm.set("allowedToPassLearnerList", gate.getAllowedToPassLearners()); + Collection forbiddenUsers = learnerService.getLearnersForGate(gate); + forbiddenUsers.removeAll(gate.getAllowedToPassLearners()); + gateForm.set("forbiddenLearnerList", forbiddenUsers); + return mapping.findForward(GateAction.VIEW_PERMISSION_GATE); + } else { + throw new MonitoringServiceException("Invalid gate activity. " + "gate id [" + gate.getActivityId() + + "] - the type [" + gate.getActivityTypeId() + "] is not a gate type"); } + } - /** - * Set up the form attributes specific to the schedule gate and navigate - * to the schedule gate view. - * - * @param mapping An ActionMapping class that will be used by the Action - * class to tell the ActionServlet where to send the end-user. - * @param gateForm The ActionForm class that will contain any data submitted - * by the end-user via a form. - * @param permissionGate the gate acitivty object - * @return An ActionForward class that will be returned to the ActionServlet - * indicating where the user is to go next. - */ - private ActionForward viewScheduleGate(ActionMapping mapping, DynaActionForm gateForm, ScheduleGateActivity scheduleGate) { - gateForm.set("startingTime", scheduleGate.getGateStartDateTime()); - gateForm.set("endingTime", scheduleGate.getGateEndDateTime()); - return mapping.findForward(GateAction.VIEW_SCHEDULE_GATE); - } + /** + * Set up the form attributes specific to the schedule gate and navigate to the schedule gate view. + * + * @param mapping + * An ActionMapping class that will be used by the Action class to tell the ActionServlet where to + * send the end-user. + * @param gateForm + * The ActionForm class that will contain any data submitted by the end-user via a form. + * @param permissionGate + * the gate acitivty object + * @return An ActionForward class that will be returned to the ActionServlet indicating where the user is to go + * next. + */ + private ActionForward viewScheduleGate(ActionMapping mapping, DynaActionForm gateForm, + ScheduleGateActivity scheduleGate) { + gateForm.set("startingTime", scheduleGate.getGateStartDateTime()); + gateForm.set("endingTime", scheduleGate.getGateEndDateTime()); + return mapping.findForward(GateAction.VIEW_SCHEDULE_GATE); + } }