Subversion Repositories SmartDukaan

Rev

Rev 22155 | Rev 22158 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22155 Rev 22156
Line 2... Line 2...
2
 
2
 
3
import java.io.File;
3
import java.io.File;
4
import java.io.IOException;
4
import java.io.IOException;
5
 
5
 
6
import javax.servlet.http.HttpServletRequest;
6
import javax.servlet.http.HttpServletRequest;
-
 
7
import javax.servlet.http.HttpServletResponse;
7
 
8
 
8
import org.apache.commons.io.FileUtils;
9
import org.apache.commons.io.FileUtils;
9
import org.slf4j.Logger;
10
import org.slf4j.Logger;
10
import org.slf4j.LoggerFactory;
11
import org.slf4j.LoggerFactory;
11
import org.springframework.beans.factory.annotation.Autowired;
12
import org.springframework.beans.factory.annotation.Autowired;
Line 36... Line 37...
36
 
37
 
37
	@Autowired
38
	@Autowired
38
	CookiesProcessor cookiesProcessor;
39
	CookiesProcessor cookiesProcessor;
39
	
40
	
40
	@RequestMapping(value = "/register", method = RequestMethod.GET)
41
	@RequestMapping(value = "/register", method = RequestMethod.GET)
41
	public String registerIndex(HttpServletRequest request, Model model) throws Throwable{
42
	public String registerIndex(HttpServletResponse response, HttpServletRequest request, Model model) throws Throwable{
42
		LoginDetails details = cookiesProcessor.getCookiesObject(request);
43
		LoginDetails details = cookiesProcessor.getCookiesObject(request);
43
		FofoForm form = Mongo.getFofoForm(details.getEmailId());
44
		FofoForm form = Mongo.getFofoForm(details.getEmailId());
44
		if (form != null) {
45
		if (form != null) {
45
			model.addAttribute("email", details.getEmailId());
46
			model.addAttribute("email", details.getEmailId());
46
			return "fofo-form";
47
			return "fofo-form";
47
		} else {
48
		} else {
-
 
49
			cookiesProcessor.removeCookies(request, response);
48
			return "fofo-thankyou";
50
			return "fofo-thankyou";
49
		}
51
		}
50
	}
52
	}
51
	
53
	
52
	@RequestMapping(value = "/register", method = RequestMethod.POST)
54
	@RequestMapping(value = "/register", method = RequestMethod.POST)
53
	public String registerIndex(HttpServletRequest request, @RequestBody FofoForm fofoForm ,Model model) throws Throwable{
55
	public String registerIndex(HttpServletResponse response, HttpServletRequest request, @RequestBody FofoForm fofoForm ,Model model) throws Throwable{
54
		Mongo.persistFofoRegInfo(fofoForm);
56
		Mongo.persistFofoRegInfo(fofoForm);
-
 
57
		cookiesProcessor.removeCookies(request, response);
55
		return "";
58
		return "fofo-thankyou";
56
	}	
59
	}	
57
	
60
	
58
	public Integer moveDocument(String documentId){
61
	public Integer moveDocument(String documentId){
59
		if (documentId == null || documentId.isEmpty()){
62
		if (documentId == null || documentId.isEmpty()){
60
			return null;
63
			return null;