View Javadoc
1   /******************************************************************************
2    * ImportPicsPageController.java - The Spring controller to load the Import Pics 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.springframework.web.servlet.ModelAndView;
19  
20  import com.buckosoft.BSAccount.web.BSAccountPageController;
21  import com.buckosoft.BSAccount.web.BSAccountUserWebSession;
22  import com.buckosoft.PicMan.business.PicManFacade;
23  
24  /** The Spring controller to load the Import Pics page. <br>
25   * See <a href="http://cvs.buckosoft.com/Projects/java/PicMan/PicMan/WebContent/WEB-INF/jsp/ImportPicsPage.jsp">ImportPicsPage.jsp</a>
26   * @author Dick Balaska
27   * @since 2008/01/30
28   */
29  public class ImportPicsPageController extends BSAccountPageController {
30  	private PicManFacade	pmf;
31  	
32  	/** Set the reference to the PicMan API.
33  	 * @param pmf The PicManFacade
34  	 */
35  	public void setPicMan(PicManFacade pmf) { this.pmf = pmf; }
36  	//public PicManFacade getPicMan() { return(pmf); }
37  
38  	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
39  				throws ServletException, IOException {
40  
41  		BSAccountUserWebSession userWebSession = this.bsAccountMan.getUserWebSession(request);
42  		
43  		String now = (new java.util.Date()).toString();
44  
45  		Map<String, Object> myModel = new HashMap<String, Object>();
46  		myModel.put("userWebSession", userWebSession);
47  		myModel.put("now", now);
48  		myModel.put("picMan", pmf);
49  		myModel.put("importsToDo", pmf.getDB().getSystem().getImportsToDo());
50  
51  		return new ModelAndView("ImportPicsPage", "model", myModel);
52  	}
53  	
54  
55  }