new Integer( executionPeriods.indexOf(selectedInfoExecutionPeriod)));
selectedInfoExecutionPeriod.getIdInternal());
	public ActionForward chooseForViewRoom(		ActionMapping mapping,		ActionForm form,		HttpServletRequest request,		HttpServletResponse response)		throws Exception {		HttpSession session = request.getSession(false);		DynaActionForm indexForm = (DynaActionForm) form;		IUserView userView = (IUserView) session.getAttribute(SessionConstants.U_VIEW);		GestorServicos gestor = GestorServicos.manager();		// get selected execution period		Object argsReadExecutionPeriods[] = {		};		ArrayList executionPeriods =			(ArrayList) gestor.executar(				userView,				"ReadExecutionPeriods",				argsReadExecutionPeriods);		ComparatorChain chainComparator = new ComparatorChain();		chainComparator.addComparator(new BeanComparator("infoExecutionYear.year"));		chainComparator.addComparator(new BeanComparator("semester"));		Collections.sort(executionPeriods, chainComparator);		Integer index = (Integer) indexForm.get("index");		InfoExecutionPeriod selectedInfoExecutionPeriod = null;		if (executionPeriods != null && index != null) {			selectedInfoExecutionPeriod =				(InfoExecutionPeriod) executionPeriods.get(index.intValue());			request.setAttribute(				SessionConstants.EXECUTION_PERIOD,				selectedInfoExecutionPeriod);			request.setAttribute(				SessionConstants.EXECUTION_PERIOD_OID,				selectedInfoExecutionPeriod.getIdInternal());		}		// set form with selected value		if (selectedInfoExecutionPeriod != null) {			indexForm = (DynaActionForm) form;			indexForm.set(				"index",				new Integer(					executionPeriods.indexOf(selectedInfoExecutionPeriod)));		}		// create execution periods label/value bean		ArrayList executionPeriodsLabelValueList = new ArrayList();		for (int i = 0; i < executionPeriods.size(); i++) {			InfoExecutionPeriod infoExecutionPeriod =				(InfoExecutionPeriod) executionPeriods.get(i);			executionPeriodsLabelValueList.add(				new LabelValueBean(					infoExecutionPeriod.getName()						+ " - "						+ infoExecutionPeriod.getInfoExecutionYear().getYear(),					"" + i));		}		request.setAttribute(			SessionConstants.LABELLIST_EXECUTIONPERIOD,			executionPeriodsLabelValueList);		// read lessons of (previously selected) room in selected executionPeriod		InfoRoom infoRoom = null;		Object argsReadRoomByOID[] = new Object[1];		if (request.getParameter(SessionConstants.ROOM_OID) != null) {			argsReadRoomByOID[0] =				new Integer(request.getParameter(SessionConstants.ROOM_OID));		} else {		}		try {			infoRoom =				(InfoRoom) ServiceUtils.executeService(					null,					"ReadRoomByOID",					argsReadRoomByOID);		} catch (FenixServiceException e) {			throw new FenixActionException();		}		request.setAttribute(SessionConstants.ROOM, infoRoom);		request.setAttribute(SessionConstants.ROOM_OID,	infoRoom.getIdInternal());		Object argsReadLessons[] = { selectedInfoExecutionPeriod, infoRoom };		try {			List lessons;			lessons =				(List) ServiceUtils.executeService(					null,					"LerAulasDeSalaEmSemestre",					argsReadLessons);			if (lessons != null) {				request.setAttribute(SessionConstants.LESSON_LIST_ATT, lessons);			}		} catch (FenixServiceException e) {			throw new FenixActionException();		}		return mapping.findForward("viewRoom");	}