@Override protected ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) throws Exception { String id = PortletRequestUtils.getStringParameter(request, "id", "NaN"); log.info( "showForm. Action: " + PortletRequestUtils.getStringParameter(request, "action", "NaN") + " | id: " + id); Map<String, Object> model = new HashMap<String, Object>(); model.put("workflows", registry.getWorkflows().values().toArray(new WorkflowDescription[0])); return new ModelAndView("viewform", model); }
/** * Handle render request internal. * * @param request the request * @param response the response * @return the model and view * @throws Exception the exception */ @Override protected ModelAndView handleRenderRequestInternal(RenderRequest request, RenderResponse response) throws Exception { // handle parameters int lectureseriesId = PortletRequestUtils.getIntParameter(request, "lectureseriesId", 0); String messageToShow = PortletRequestUtils.getStringParameter(request, "messageToShow", ""); String colorMsg = PortletRequestUtils.getStringParameter(request, "colorMsg", ""); Map<String, Serializable> model = new HashMap<String, Serializable>(); String finalView = ""; if (lectureseriesId == 0) { // showing list view model.put("msg", messageToShow); finalView = "producerLectureseriesManagement"; } else { // showing detail view AdminLectureseriesModel myModel = new AdminLectureseriesModel(); List<Lectureseries> data = ((LectureseriesDao) getDaoBeanFactory().getBean("lectureseriesDao")) .getById(lectureseriesId); if (data != null && !data.isEmpty()) { Lectureseries lectureseries = data.get(0); myModel.setId(lectureseriesId); myModel.setLectureseriesNumber(lectureseries.getNumber()); myModel.setLectureseriesName(lectureseries.getName()); myModel.setEventType(lectureseries.getEventType()); myModel.setEventCategory(lectureseries.getEventCategory()); myModel.setShortDescription(lectureseries.getShortDesc()); myModel.setLongDescription(lectureseries.getLongDesc()); myModel.setSemesterName(lectureseries.getSemesterName()); myModel.setInstructorNames(lectureseries.getInstructorsString()); myModel.setLectureseriesLanguage(lectureseries.getLanguage()); myModel.setFacultyName(lectureseries.getFaculty_name()); myModel.setPassword(lectureseries.getPassword()); Map<String, String> faculties = new HashMap<String, String>(); for (Facility faculty : ((FacilityDao) getDaoBeanFactory().getBean("facilityDao")) .getFromLectureseriesId(lectureseriesId)) { faculties.put("" + faculty.getId(), faculty.getName()); } myModel.setFaculties(faculties); Map<String, String> lang = new HashMap<String, String>(); if (lectureseries.getLanguage() != null && !"".equals(lectureseries.getLanguage())) { for (String key : lectureseries.getLanguage().trim().split(", ")) { lang.put(key, key); } } myModel.setLanguages(lang); model.put("model", myModel); finalView = "lectureseriesShow"; } else { finalView = "producerLectureseriesManagement"; messageToShow = "Keine Veranstaltung mit dieser id!"; colorMsg = "#ff0000"; } model.put("msg", messageToShow); model.put("colorMsg", colorMsg); } return new ModelAndView(finalView, model); }