Subversion Repositories SmartDukaan

Rev

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

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