/** * On submit action. * * @param request the request * @param response the response * @param command the command * @param errors the errors */ @Override protected void onSubmitAction( ActionRequest request, ActionResponse response, Object command, BindException errors) { ProducerVideoDataInputEditModel model = (ProducerVideoDataInputEditModel) command; // upload -- enctype="multipart/form-data" if (PortletFileUpload.isMultipartContent(request)) doUpload(request, response, model); // delete requested files String action = request.getParameter("action"); Integer vidId = new Integer(request.getParameter("videoId")); // update video-object for model // here get video object List<Video> videoList = ((VideoDao) getDaoBeanFactory().getBean("videoDao")).getById(vidId); Video video = videoList.iterator().next(); // -- video object end try { // delete video request if (action.equals("deleteVideo")) { deleteMp3(model); model.setMp3File(null); deleteM4v(model); model.setM4vFile(null); deletePdf(model); model.setPdfFile(null); deleteM4a(model); model.setM4aFile(null); deleteTar(model); // has to be at the and deleteVideo(model); } // delete mp3 request if (action.equals("deleteMp3")) { deleteMp3(model); model.setMp3File(null); } // delete m4v request if (action.equals("deleteM4v")) { deleteM4v(model); model.setM4vFile(null); } // delete m4a request if (action.equals("deleteM4a")) { deleteM4a(model); model.setM4aFile(null); } // delete pdf request if (action.equals("deletePdf")) { deletePdf(model); model.setPdfFile(null); } // upload request if (action.equals("upload")) { // check for mp3 or mp4 file // here update mp3-file in model try { if (video.getMp3File().isFile()) model.setMp3File(video.getMp3File().toString()); } catch (NullPointerException npe) { } // update model model.setVideo(video); model.setURL(null); } } catch (Exception e) { } }