Subversion Repositories SmartDukaan

Rev

Rev 637 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 637 Rev 741
Line 1... Line 1...
1
/**
1
/**
2
 * 
2
 * 
3
 */
3
 */
4
package in.shop2020.serving.controllers;
4
package in.shop2020.serving.controllers;
5
 
5
 
-
 
6
import java.io.File;
-
 
7
import java.util.ArrayList;
-
 
8
import java.util.HashMap;
6
import java.util.List;
9
import java.util.List;
-
 
10
import java.util.Map;
7
 
11
 
8
import in.shop2020.model.v1.catalog.InventoryServiceException;
12
import in.shop2020.model.v1.catalog.InventoryServiceException;
-
 
13
import in.shop2020.serving.utils.FileUtils;
-
 
14
import in.shop2020.serving.utils.Utils;
9
import in.shop2020.thrift.clients.CatalogServiceClient;
15
import in.shop2020.thrift.clients.CatalogServiceClient;
10
 
16
 
11
import org.apache.juli.logging.Log;
17
import org.apache.juli.logging.Log;
12
import org.apache.juli.logging.LogFactory;
18
import org.apache.juli.logging.LogFactory;
13
import org.apache.struts2.rest.DefaultHttpHeaders;
19
import org.apache.struts2.rest.DefaultHttpHeaders;
Line 75... Line 81...
75
			e.printStackTrace();
81
			e.printStackTrace();
76
		}
82
		}
77
    	return new DefaultHttpHeaders("show");
83
    	return new DefaultHttpHeaders("show");
78
    }
84
    }
79
    
85
    
80
    public List<Long> getItems(){
86
    public List<String> getItems() throws Exception{
-
 
87
    	ArrayList<String> snippets = new ArrayList<String>();
-
 
88
    	if(items != null){
-
 
89
    		for(long item: items){
-
 
90
				snippets.add(FileUtils.read( Utils.EXPORT_ENTITIES_PATH + item + File.separator +"CategorySnippet.html"));
-
 
91
			}
-
 
92
    	}
-
 
93
		
81
    	return items;
94
    	return snippets;
82
    }
95
    }
83
    
96
    
84
	public void setId(String id) {
97
	public void setId(String id) {
85
		this.id = id;
98
		this.id = id;
86
		this.beginIndex = this.windowSize * (Long.parseLong(id)-1);
99
		this.beginIndex = this.windowSize * (Long.parseLong(id)-1);