Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
21920 rajender 1
package in.shop2020.dtrapi.controllers;
2
 
3
import java.net.MalformedURLException;
4
import java.net.URL;
5
import java.util.Arrays;
6
import java.util.HashMap;
7
import java.util.Iterator;
8
import java.util.List;
9
import java.util.Map;
10
 
11
 
12
import org.json.JSONObject;
13
 
14
import com.google.gson.Gson;
15
 
16
import in.shop2020.dtrapi.Storage.Mongo;
17
import in.shop2020.dtrapi.models.FofoForm;
18
 
19
public class FofoController extends BaseController {
20
	/**
21
	 * 
22
	 */
23
	private static List<String> DOCUMENT_NAMES = Arrays.asList("bEntityDoc","angleDoc1","gstDoc","panDoc","itrDoc","angleDoc2","angleDoc3","angleDoc4","angleDoc5","ownershipDoc","insuranceDoc","loanDoc","sanctionDoc","chequeCopy");
24
 
25
	private static final long serialVersionUID = 1L;
26
 
27
	private int id;
28
 
29
 
30
	public String index(){
31
		return "index";
32
	}
33
 
34
	public String edit(){
35
		return "edit";
36
	}
37
 
38
 
39
	public int getId() {
40
		return id;
41
	}
42
 
43
	public void setId(int id) {
44
		this.id = id;
45
	}
46
 
47
 
48
	public FofoForm fofoForm() {
49
		FofoForm x = Mongo.getFofoForm(id);
50
		System.out.println(x.toString());
51
		return x;
52
	}
53
 
54
	public String fofoFormJson(){
55
		//return new JSONObject(this.fofoForm()).toString();
56
		return new Gson().toJson(this.fofoForm());
57
	}
58
 
59
	public List<FofoForm> getLatestFofo() {
60
		return Mongo.getFofoForms(0, 10);
61
	}
62
 
63
	private String getUrlFromDocumentPath(String documentName, String documentPath) {
64
		if(DOCUMENT_NAMES.contains(documentPath)) {
65
			return documentPath;	
66
		}
67
		return documentPath;
68
 
69
	}
70
}