Subversion Repositories SmartDukaan

Rev

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

Rev 9322 Rev 9325
Line 53... Line 53...
53
	private HttpSession session;
53
	private HttpSession session;
54
 
54
 
55
	private String id;
55
	private String id;
56
	private String errorMsg = "";
56
	private String errorMsg = "";
57
 
57
 
58
	private String pricingFileName;
-
 
59
	long vendorId;
58
	long vendorId;
60
	private File pricingFile;
-
 
61
	
59
	
-
 
60
	private File pricingFile;
-
 
61
    private String pricingFileContentType;
-
 
62
    private String pricingFileFileName;
-
 
63
    
62
	public String index() {
64
	public String index() {
63
		if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getServletPath()))
65
		if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getServletPath()))
64
			return "authfail";
66
			return "authfail";
65
		return "authsuccess";
67
		return "authsuccess";
66
	}
68
	}
Line 71... Line 73...
71
	
73
	
72
	
74
	
73
	public String create() throws InventoryServiceException, TException, CatalogServiceException {
75
	public String create() throws InventoryServiceException, TException, CatalogServiceException {
74
		File fileToCreate = null;
76
		File fileToCreate = null;
75
        try {
77
        try {
76
            fileToCreate = new File("/tmp/", this.pricingFileName);
78
            fileToCreate = new File("/tmp/", this.pricingFileFileName);
77
            FileUtils.copyFile(this.pricingFile, fileToCreate);
79
            FileUtils.copyFile(this.pricingFile, fileToCreate);
78
        } catch (Exception e) {
80
        } catch (Exception e) {
79
           logger.error("Error while writing pricing file to the local file system", e);
81
           logger.error("Error while writing pricing file to the local file system", e);
80
           addActionError("Error while writing  pricing file report to the local file system");
82
           addActionError("Error while writing  pricing file report to the local file system");
81
        }
83
        }
Line 137... Line 139...
137
 
139
 
138
    public void setPricingFile(File pricingFile) {
140
    public void setPricingFile(File pricingFile) {
139
        this.pricingFile = pricingFile;
141
        this.pricingFile = pricingFile;
140
    }
142
    }
141
	
143
	
142
	public String getPricingFileName() {
144
	public String getPricingFileFileName() {
143
        return pricingFileName;
145
        return pricingFileFileName;
144
    }
146
    }
145
 
147
 
146
    public void setPricingFileName(String pricingFileName) {
148
    public void setPricingFileFileName(String pricingFileFileName) {
147
        this.pricingFileName = pricingFileName;
149
        this.pricingFileFileName = pricingFileFileName;
148
    }
150
    }
149
    
151
    
150
	@Override
152
	@Override
151
	public void setServletRequest(HttpServletRequest request) {
153
	public void setServletRequest(HttpServletRequest request) {
152
		this.request = request;
154
		this.request = request;
Line 186... Line 188...
186
        }
188
        }
187
        Client invClient = isc.getClient();
189
        Client invClient = isc.getClient();
188
        return invClient.getAllVendors();
190
        return invClient.getAllVendors();
189
	}
191
	}
190
 
192
 
-
 
193
	public void setPricingFileContentType(String pricingFileContentType) {
-
 
194
		this.pricingFileContentType = pricingFileContentType;
-
 
195
	}
-
 
196
 
-
 
197
	public String getPricingFileContentType() {
-
 
198
		return pricingFileContentType;
-
 
199
	}
-
 
200
 
191
}
201
}