Coverage Report - com.buckosoft.PicMan.web.FilterReportSummaryPageController
 
Classes in this File Line Coverage Branch Coverage Complexity
FilterReportSummaryPageController
0%
0/20
0%
0/4
2
 
 1  
 /******************************************************************************
 2  
  * FilterReportSummaryPageController.java - The Spring controller for the filter summary report
 3  
  * 
 4  
  * PicMan - The BuckoSoft Picture Manager in Java
 5  
  * Copyright(c) 2005 - Dick Balaska
 6  
  * 
 7  
  */
 8  
 package com.buckosoft.PicMan.web;
 9  
 
 10  
 import java.io.IOException;
 11  
 import java.util.Date;
 12  
 import java.util.HashMap;
 13  
 import java.util.Map;
 14  
 
 15  
 import javax.servlet.ServletException;
 16  
 import javax.servlet.http.HttpServletRequest;
 17  
 import javax.servlet.http.HttpServletResponse;
 18  
 
 19  
 import org.apache.commons.logging.Log;
 20  
 import org.apache.commons.logging.LogFactory;
 21  
 import org.springframework.web.servlet.ModelAndView;
 22  
 
 23  
 import com.buckosoft.BSAccount.web.BSAccountPageController;
 24  
 import com.buckosoft.BSAccount.web.BSAccountUserWebSession;
 25  
 import com.buckosoft.PicMan.business.PicManFacade;
 26  
 
 27  
 /**
 28  
  * The Spring controller for the Filter Summary Report. <br>
 29  
  * Page moved from static to AJAX in July '08. <br>
 30  
  * See <a href="http://cvs.buckosoft.com/Projects/java/PicMan/PicMan/WebContent/WEB-INF/jsp/FilterSummaryReport.jsp">FilterSummaryReport.jsp</a>
 31  
  * which is pretty boring.  All the good stuff happens in the javascript
 32  
  * <a href="http://cvs.buckosoft.com/Projects/java/PicMan/PicMan/WebContent/js/filterReportSummary.js">filterReportSummary.js</a>
 33  
  * and
 34  
  * <a href="http://cvs.buckosoft.com/Projects/java/PicMan/PicMan/WebContent/js/filterEditAjax.js">filterEditAjax.js</a>.
 35  
  * @author Dick Balaska
 36  
  * @since 2005/08/05
 37  
  * @see com.buckosoft.PicMan.dom.SetManDom
 38  
  * @see com.buckosoft.PicMan.dom.PicsInSetDom
 39  
  */
 40  0
 public class FilterReportSummaryPageController extends BSAccountPageController {
 41  
 
 42  
 //        private final static boolean DEBUG = true;
 43  
         private PicManFacade pmf;
 44  
 
 45  
         /** Set the reference to the PicMan API.
 46  
          * @param pmf The PicManFacade
 47  
          */
 48  0
         public void setPicMan(PicManFacade pmf) { this.pmf = pmf; }
 49  
         
 50  
     /** Logger for this class and subclasses */
 51  0
     protected final Log logger = LogFactory.getLog(getClass());
 52  
 
 53  
         public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
 54  
                         throws ServletException, IOException {
 55  
 
 56  0
                 BSAccountUserWebSession userWebSession = this.bsAccountMan.getUserWebSession(request);
 57  
                 
 58  0
                 String now = (new java.util.Date()).toString();
 59  
 
 60  0
         Map<String, Object> myModel = new HashMap<String, Object>();
 61  0
         myModel.put("userWebSession", userWebSession);
 62  0
         myModel.put("now", now);
 63  0
                 myModel.put("prettyPrint", (request.getParameter("prettyPrint") != null) ? "1" : "0");
 64  0
                 HashMap<String, Date> hm = pmf.getDB().getSetTimestamps();
 65  0
                 StringBuilder sb = new StringBuilder();
 66  0
                 for (String key : hm.keySet()) {
 67  0
                         sb.append("setTimestampArray[\"");
 68  0
                         sb.append(key);
 69  0
                         sb.append("\"]=\"");
 70  0
                         sb.append(hm.get(key));
 71  0
                         sb.append("\";\n");
 72  0
                 }
 73  
                 
 74  0
                 myModel.put("timestamps", sb.toString());
 75  
                 
 76  
                 
 77  0
         return new ModelAndView("FilterReportSummary", "model", myModel);
 78  
     }
 79  
 }