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