Subversion Repositories SmartDukaan

Rev

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

Rev 2198 Rev 2202
Line 50... Line 50...
50
import java.util.List;
50
import java.util.List;
51
import java.util.Map;
51
import java.util.Map;
52
 
52
 
53
import javax.imageio.ImageIO;
53
import javax.imageio.ImageIO;
54
 
54
 
-
 
55
import org.apache.commons.io.FileUtils;
-
 
56
import org.apache.commons.lang.StringEscapeUtils;
55
import org.apache.commons.lang.StringUtils;
57
import org.apache.commons.lang.StringUtils;
56
import org.apache.velocity.Template;
58
import org.apache.velocity.Template;
57
import org.apache.velocity.VelocityContext;
59
import org.apache.velocity.VelocityContext;
58
import org.apache.velocity.app.Velocity;
60
import org.apache.velocity.app.Velocity;
59
import org.apache.velocity.exception.MethodInvocationException;
61
import org.apache.velocity.exception.MethodInvocationException;
Line 194... Line 196...
194
		// a particular entity are always downloaded from the same location.
196
		// a particular entity are always downloaded from the same location.
195
		String staticurl = "http://static" + entity.getID()%3 + "." + domain;
197
		String staticurl = "http://static" + entity.getID()%3 + "." + domain;
196
		
198
		
197
		templateFile= Utils.VTL_SRC_PATH + "product_summary.vm";
199
		templateFile= Utils.VTL_SRC_PATH + "product_summary.vm";
198
		getProductSummaryHtml(expEntity, items, templateFile, exportPath);
200
		getProductSummaryHtml(expEntity, items, templateFile, exportPath);
-
 
201
		FileUtils.writeStringToFile(new File("ProductDetail.html"), StringEscapeUtils.escapeHtml(FileUtils.readFileToString(new File("ProductDetail.html"))));
-
 
202
		
199
		
203
		
200
		templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_widget.vm";
204
		templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_widget.vm";
201
		getEntityWidgetSnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
205
		getEntityWidgetSnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
-
 
206
		FileUtils.writeStringToFile(new File("WidgetSnippet.html"), StringEscapeUtils.escapeHtml(FileUtils.readFileToString(new File("WidgetSnippet.html"))));
-
 
207
		
202
		
208
		
203
		templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_homepage.vm";
209
		templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_homepage.vm";
204
		getEntityHomeSnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
210
		getEntityHomeSnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
-
 
211
		FileUtils.writeStringToFile(new File("HomeSnippet.html"), StringEscapeUtils.escapeHtml(FileUtils.readFileToString(new File("HomeSnippet.html"))));
-
 
212
		
205
		
213
		
206
		templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_searchpage.vm";
214
		templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_searchpage.vm";
207
		getEntitySearchSnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
215
		getEntitySearchSnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
-
 
216
		FileUtils.writeStringToFile(new File("SearchSnippet.html"), StringEscapeUtils.escapeHtml(FileUtils.readFileToString(new File("SearchSnippet.html"))));
-
 
217
		
208
		
218
		
209
		templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_categorypage.vm";
219
		templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_categorypage.vm";
210
		getEntityCategorySnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
220
		getEntityCategorySnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
-
 
221
		FileUtils.writeStringToFile(new File("CategorySnippet.html"), StringEscapeUtils.escapeHtml(FileUtils.readFileToString(new File("CategorySnippet.html"))));
-
 
222
		
211
		
223
		
212
		templateFile= Utils.VTL_SRC_PATH + "slideguide_img_video.vm";
224
		templateFile= Utils.VTL_SRC_PATH + "slideguide_img_video.vm";
213
		getEntitySlideGuideHtml(expEntity, templateFile, domain, exportPath);
225
		getEntitySlideGuideHtml(expEntity, templateFile, domain, exportPath);
-
 
226
		FileUtils.writeStringToFile(new File("SlideGuide.html"), StringEscapeUtils.escapeHtml(FileUtils.readFileToString(new File("SlideGuide.html"))));
214
 
227
		
215
	    
-
 
216
		templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_phones_i_own.vm";
228
		templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_phones_i_own.vm";
217
		getEntityPhonesIOwnSnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
229
		getEntityPhonesIOwnSnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
-
 
230
		FileUtils.writeStringToFile(new File("PhonesIOwnSnippet.html"), StringEscapeUtils.escapeHtml(FileUtils.readFileToString(new File("PhonesIOwnSnippet.html"))));
218
		
231
		
219
		if(expEntity.getCategory().getParentCategory().getID() == Utils.MOBILE_PHONES_CATAGOEY){
232
		if(expEntity.getCategory().getParentCategory().getID() == Utils.MOBILE_PHONES_CATAGOEY){
220
		    
233
		    
221
		    templateFile= Utils.VTL_SRC_PATH + "slideguide_for_comparison.vm";
234
		    templateFile= Utils.VTL_SRC_PATH + "slideguide_for_comparison.vm";
222
	        getEntitySnippetForComparison(expEntity, templateFile, domain, exportPath);
235
	        getEntitySnippetForComparison(expEntity, templateFile, domain, exportPath);
-
 
236
	        FileUtils.writeStringToFile(new File("ComparisonSnippet.html"), StringEscapeUtils.escapeHtml(FileUtils.readFileToString(new File("ComparisonSnippet.html"))));
223
	        
237
	        
224
	        templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_comparisonpage.vm";
238
	        templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_comparisonpage.vm";
225
	        getEntityCompareSnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
239
	        getEntityCompareSnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
-
 
240
	        FileUtils.writeStringToFile(new File("CompareProductSnippet.html"), StringEscapeUtils.escapeHtml(FileUtils.readFileToString(new File("CompareProductSnippet.html"))));
226
	            
241
	        
227
            templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_comparisonpage_summary.vm";
242
            templateFile= Utils.VTL_SRC_PATH + "entity_snippet_for_comparisonpage_summary.vm";
228
            getEntityCompareSummarySnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
243
            getEntityCompareSummarySnippetHtml(expEntity, items, templateFile, staticurl, exportPath);
-
 
244
            FileUtils.writeStringToFile(new File("CompareProductSummarySnippet.html"), StringEscapeUtils.escapeHtml(FileUtils.readFileToString(new File("CompareProductSummarySnippet.html"))));
229
 
245
            
230
            getSlidenamesSnippet(expEntity, exportPath);
246
            getSlidenamesSnippet(expEntity, exportPath);
231
		}
247
		}
232
		
248
		
233
		getEntityTitleSnippetHtml(expEntity, exportPath);
249
		getEntityTitleSnippetHtml(expEntity, exportPath);
234
		
250