| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| FilterEditPageController |
|
| 2.0;2 |
| 1 | /****************************************************************************** | |
| 2 | * FilterEditPageController.java - The Spring controller for the new AJAX based Filter Editor | |
| 3 | * | |
| 4 | * PicMan - The BuckoSoft Picture Manager in Java | |
| 5 | * Copyright(c) 2008 - Dick Balaska | |
| 6 | * | |
| 7 | */ | |
| 8 | package com.buckosoft.PicMan.web; | |
| 9 | ||
| 10 | import java.io.IOException; | |
| 11 | import java.util.HashMap; | |
| 12 | import java.util.Map; | |
| 13 | ||
| 14 | import javax.servlet.ServletException; | |
| 15 | import javax.servlet.http.HttpServletRequest; | |
| 16 | import javax.servlet.http.HttpServletResponse; | |
| 17 | ||
| 18 | import org.springframework.web.servlet.ModelAndView; | |
| 19 | ||
| 20 | import com.buckosoft.BSAccount.web.BSAccountPageController; | |
| 21 | import com.buckosoft.BSAccount.web.BSAccountUserWebSession; | |
| 22 | import com.buckosoft.PicMan.domain.User; | |
| 23 | ||
| 24 | /** | |
| 25 | * The Spring controller for the new AJAX based Filter Editor. <br> | |
| 26 | * See <a href="http://cvs.buckosoft.com/Projects/PicMan/PicMan/WebContent/WEB-INF/jsp/FilterEditPage.jsp">FilterEditPage.jsp</a> | |
| 27 | * which is pretty boring. All the good stuff happens in the javascript | |
| 28 | * <a href="http://cvs.buckosoft.com/Projects/PicMan/PicMan/WebContent/js/filterEdit.js">filterEdit.js</a> | |
| 29 | * and | |
| 30 | * <a href="http://cvs.buckosoft.com/Projects/PicMan/PicMan/WebContent/js/filterEditAjax.js">filterEditAjax.js</a>. <br/> | |
| 31 | * <a href="http://cvs.buckosoft.com/Projects/PicMan/PicMan/WebContent/js/filterEditor.js">filterEditor.js</a> | |
| 32 | * defines the actual editing of a single pic and its filters. <br/> | |
| 33 | * | |
| 34 | * This page takes one optional parameter: pic=b2000010101 which sets up the editor for that page. | |
| 35 | * @author Dick Balaska | |
| 36 | * @since 2008/01/05 | |
| 37 | * @see <a href="http://cvs.buckosoft.com/Projects/PicMan/PicMan/src/main/java/com/buckosoft/PicMan/web/FilterEditPageController.java">FilterEditPageController.java</a> | |
| 38 | * @version $Revision: 1.2 $ <br> $Date: 2014/06/05 06:35:08 $ | |
| 39 | */ | |
| 40 | 0 | public class FilterEditPageController extends BSAccountPageController { |
| 41 | ||
| 42 | /** Spring standard http request handler | |
| 43 | * @param request The http request | |
| 44 | * @param response The http response | |
| 45 | * @return The Spring Model and View | |
| 46 | */ | |
| 47 | public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) | |
| 48 | throws ServletException, IOException { | |
| 49 | ||
| 50 | 0 | BSAccountUserWebSession userWebSession = this.bsAccountMan.getUserWebSession(request); |
| 51 | 0 | User user = (User)userWebSession.getUser(); |
| 52 | ||
| 53 | 0 | String now = (new java.util.Date()).toString(); |
| 54 | ||
| 55 | 0 | Map<String, Object> myModel = new HashMap<String, Object>(); |
| 56 | 0 | myModel.put("userWebSession", userWebSession); |
| 57 | 0 | myModel.put("now", now); |
| 58 | 0 | myModel.put("user", user); |
| 59 | ||
| 60 | 0 | String v = request.getParameter("pic"); |
| 61 | 0 | if (v != null) |
| 62 | 0 | myModel.put("pic", v); |
| 63 | ||
| 64 | 0 | return new ModelAndView("FilterEditPage", "model", myModel); |
| 65 | } | |
| 66 | ||
| 67 | } |