Coverage Report - com.buckosoft.PicMan.web.SyncStatusPageController
 
Classes in this File Line Coverage Branch Coverage Complexity
SyncStatusPageController
0%
0/15
N/A
1
 
 1  
 /******************************************************************************
 2  
  * SyncStatusPageController.java - The Spring controller for the sync status page.
 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.apache.commons.logging.Log;
 19  
 import org.apache.commons.logging.LogFactory;
 20  
 import org.springframework.web.servlet.ModelAndView;
 21  
 
 22  
 import com.buckosoft.BSAccount.web.BSAccountPageController;
 23  
 import com.buckosoft.BSAccount.web.BSAccountUserWebSession;
 24  
 import com.buckosoft.PicMan.business.PicManFacade;
 25  
 import com.buckosoft.PicMan.db.DatabaseFacade;
 26  
 
 27  
 /** The Spring controller for the sync status page.
 28  
  * @author Dick Balaska
 29  
  * @since 2005/11/23
 30  
  * @see <a href="http://cvs.buckosoft.com/Projects/java/PicMan/PicMan/src/com/buckosoft/PicMan/web/SyncStatusPageController.java">SyncStatusPageController.java</a>
 31  
  */
 32  0
 public class SyncStatusPageController extends BSAccountPageController {
 33  
         
 34  
 //        private final static boolean DEBUG = false;
 35  0
         protected final Log logger = LogFactory.getLog(getClass());
 36  
         
 37  
         private PicManFacade        pmf;
 38  
         private DatabaseFacade        dbf;
 39  
         
 40  
         /** Set the reference to the PicMan API
 41  
          * @param pmf The PicManFacade
 42  
          */
 43  
         public void setPicMan(PicManFacade pmf) { 
 44  0
                 this.pmf = pmf;
 45  0
                 this.dbf = pmf.getDB();
 46  0
         }
 47  
         /** bean getter so Spring AOP can determine the type
 48  
          * @return The PicManFacade
 49  
          */
 50  0
         public PicManFacade getPicMan() { return(pmf); }
 51  
 
 52  0
         public void setDatabase(DatabaseFacade dbf) { this.dbf = dbf; }
 53  
         /** bean getter so Spring AOP can determine the type
 54  
          * @return The DatabaseFacade
 55  
          */
 56  0
         public DatabaseFacade getDatabase() { return(dbf); }
 57  
 
 58  
         /** Build the model that spring outputs to the browser
 59  
          * @param request The http request
 60  
          * @param response The http response
 61  
          */
 62  
         public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
 63  
                         throws ServletException, IOException {
 64  
 
 65  0
                    BSAccountUserWebSession userWebSession = this.bsAccountMan.getUserWebSession(request);
 66  0
             Map<String, Object> myModel = new HashMap<String, Object>();
 67  0
                 myModel.put("userWebSession", userWebSession);
 68  0
                 myModel.put("picMan", pmf);
 69  0
                 myModel.put("database", dbf);
 70  0
                 myModel.put("refreshDelay", 2);
 71  
                 //myModel.put("engineRunningText", pmf.engineRunningShortStatus());
 72  0
         return new ModelAndView("SyncStatus", "model", myModel);
 73  
         }
 74  
 }