Subversion Repositories SmartDukaan

Rev

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

Rev 3126 Rev 3599
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
import in.shop2020.model.v1.user.UserContextService;
3
import in.shop2020.model.v1.user.UserContextService;
4
import in.shop2020.model.v1.user.WidgetException;
4
import in.shop2020.model.v1.user.WidgetException;
5
import in.shop2020.serving.utils.FileUtils;
5
import in.shop2020.serving.services.ContentServingService;
6
import in.shop2020.serving.utils.Utils;
6
import in.shop2020.serving.utils.SnippetType;
7
import in.shop2020.thrift.clients.UserClient;
7
import in.shop2020.thrift.clients.UserClient;
8
 
8
 
9
import java.io.File;
-
 
10
import java.io.FileNotFoundException;
-
 
11
import java.io.IOException;
-
 
12
import java.util.ArrayList;
9
import java.util.ArrayList;
13
import java.util.List;
10
import java.util.List;
14
 
11
 
15
import org.apache.log4j.Logger;
12
import org.apache.log4j.Logger;
16
import org.apache.struts2.convention.annotation.Action;
13
import org.apache.struts2.convention.annotation.Action;
Line 67... Line 64...
67
	}
64
	}
68
 
65
 
69
    public String getSnippets() {
66
    public String getSnippets() {
70
    	if(items != null){
67
    	if(items != null){
71
	    	for(String itemId: items){
68
	    	for(String itemId: items){
72
	    	    try {
-
 
73
				    snippets = snippets + FileUtils.read( Utils.EXPORT_ENTITIES_PATH + itemId + File.separator +"WidgetSnippet.html");
69
	    		snippets = snippets + ContentServingService.getSnippet(SnippetType.WIDGET_SNIPPET, itemId, sourceId);
74
	    	    }
-
 
75
	    	    catch (FileNotFoundException e) {
-
 
76
                    log.error(e.getMessage());
-
 
77
                }
-
 
78
	    	    catch (IOException e) {
-
 
79
                    log.error(e.getMessage());
-
 
80
                }
-
 
81
			}
70
			}
82
    	}
71
    	}
83
		return snippets;
72
		return snippets;
84
    }
73
    }
85
 
74