Subversion Repositories SmartDukaan

Rev

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

Rev 1044 Rev 1371
Line 2... Line 2...
2
 * 
2
 * 
3
 */
3
 */
4
package in.shop2020.serving.controllers;
4
package in.shop2020.serving.controllers;
5
 
5
 
6
import java.io.File;
6
import java.io.File;
-
 
7
import java.io.IOException;
7
import java.util.ArrayList;
8
import java.util.ArrayList;
8
import java.util.List;
9
import java.util.List;
9
 
10
 
10
import in.shop2020.model.v1.catalog.InventoryServiceException;
11
import in.shop2020.model.v1.catalog.InventoryServiceException;
11
import in.shop2020.serving.utils.FileUtils;
12
import in.shop2020.serving.utils.FileUtils;
Line 75... Line 76...
75
			e.printStackTrace();
76
			e.printStackTrace();
76
		}
77
		}
77
    	return new DefaultHttpHeaders("show");
78
    	return new DefaultHttpHeaders("show");
78
    }
79
    }
79
    
80
    
80
    public List<String> getItems() throws Exception{
81
    public List<String> getItems() {
81
    	ArrayList<String> snippets = new ArrayList<String>();
82
    	ArrayList<String> snippets = new ArrayList<String>();
82
    	if(items != null){
83
    	if(items != null){
83
    		for(long item: items){
84
    		for(long item: items){
-
 
85
				try {
84
				snippets.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"CategorySnippet.html"));
86
					snippets.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"CategorySnippet.html"));
-
 
87
				} catch (IOException ioex) {
-
 
88
					ioex.printStackTrace();
-
 
89
    				log.error(ioex);
-
 
90
				}
85
			}
91
			}
86
    	}
92
    	}
87
		
93
		
88
    	return snippets;
94
    	return snippets;
89
    }    
95
    } 
-
 
96
    
90
	public void setId(String id) {
97
	public void setId(String id) {
91
		this.id = id;
98
		this.id = id;
92
		this.beginIndex = this.windowSize * (Long.parseLong(id)-1);
99
		this.beginIndex = this.windowSize * (Long.parseLong(id)-1);
93
	}
100
	}
94
 
101