| Line 173... |
Line 173... |
| 173 |
context.put("OFFER_DETAIL_LINK", offerDetailLink);
|
173 |
context.put("OFFER_DETAIL_LINK", offerDetailLink);
|
| 174 |
context.put("AFTER_ARRIVAL", afterArrival);
|
174 |
context.put("AFTER_ARRIVAL", afterArrival);
|
| 175 |
context.put("SHOW_PRICE", domain.contains("store")?"FALSE":showPrice);
|
175 |
context.put("SHOW_PRICE", domain.contains("store")?"FALSE":showPrice);
|
| 176 |
context.put("IS_STORE", domain.contains("store")?"TRUE":"FALSE");
|
176 |
context.put("IS_STORE", domain.contains("store")?"TRUE":"FALSE");
|
| 177 |
List<String> filenames = new ArrayList<String>();
|
177 |
List<String> filenames = new ArrayList<String>();
|
| - |
|
178 |
if(!domain.contains("store")){
|
| - |
|
179 |
filenames.add("WidgetSnippet");
|
| 178 |
filenames.add("ProductDetail");
|
180 |
filenames.add("ProductPropertiesSnippet");
|
| 179 |
filenames.add("WidgetSnippet");
|
181 |
filenames.add("MyResearchSnippet");
|
| 180 |
filenames.add("HomeSnippet");
|
182 |
filenames.add("AfterSales");
|
| 181 |
filenames.add("SearchSnippet");
|
183 |
filenames.add("SearchSnippet");
|
| 182 |
filenames.add("CategorySnippet");
|
184 |
filenames.add("CategorySnippet");
|
| - |
|
185 |
filenames.add("HomeSnippet");
|
| - |
|
186 |
filenames.add("ProductDetail");
|
| 183 |
filenames.add("SlideGuide");
|
187 |
filenames.add("SlideGuide");
|
| - |
|
188 |
}else {
|
| 184 |
filenames.add("ProductPropertiesSnippet");
|
189 |
filenames.add("store/" + catalogId + "/SearchSnippet");
|
| - |
|
190 |
filenames.add("store/" + catalogId + "/CategorySnippet");
|
| 185 |
filenames.add("MyResearchSnippet");
|
191 |
filenames.add("store/" + catalogId + "/HomeSnippet");
|
| - |
|
192 |
filenames.add("store/" + catalogId + "/ProductDetail");
|
| 186 |
filenames.add("AfterSales");
|
193 |
filenames.add("store/" + catalogId + "/SlideGuide");
|
| - |
|
194 |
}
|
| 187 |
|
195 |
|
| 188 |
Category category = Catalog.getInstance().getDefinitionsContainer().getCategory(items.get(0).getCategory());
|
196 |
Category category = Catalog.getInstance().getDefinitionsContainer().getCategory(items.get(0).getCategory());
|
| 189 |
if(category!=null){
|
197 |
if(category!=null && !domain.contains("store")){
|
| 190 |
Category parentCategory = category.getParentCategory();
|
198 |
Category parentCategory = category.getParentCategory();
|
| 191 |
|
199 |
|
| 192 |
if(parentCategory.getID() == Utils.MOBILE_PHONES_CATAGORY) {
|
200 |
if(parentCategory.getID() == Utils.MOBILE_PHONES_CATAGORY) {
|
| 193 |
filenames.add("PhonesIOwnSnippet");
|
201 |
filenames.add("PhonesIOwnSnippet");
|
| 194 |
}
|
202 |
}
|
| Line 214... |
Line 222... |
| 214 |
p.setProperty("resource.loader", "file");
|
222 |
p.setProperty("resource.loader", "file");
|
| 215 |
p.setProperty("file.resource.loader.class","org.apache.velocity.runtime.resource.loader.FileResourceLoader");
|
223 |
p.setProperty("file.resource.loader.class","org.apache.velocity.runtime.resource.loader.FileResourceLoader");
|
| 216 |
p.setProperty( "file.resource.loader.path", Utils.EXPORT_VELOCITY_PATH);
|
224 |
p.setProperty( "file.resource.loader.path", Utils.EXPORT_VELOCITY_PATH);
|
| 217 |
Velocity.init(p);
|
225 |
Velocity.init(p);
|
| 218 |
for(String filename: filenames){
|
226 |
for(String filename: filenames){
|
| - |
|
227 |
if(filename.contains("store/")){
|
| - |
|
228 |
Template template = Velocity.getTemplate(filename + ".vm");
|
| - |
|
229 |
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(exportPath + File.separator + filename.split(""+ catalogId +"/")[1] +".html")));
|
| - |
|
230 |
template.merge(context, writer);
|
| - |
|
231 |
writer.flush();
|
| - |
|
232 |
writer.close();
|
| - |
|
233 |
|
| - |
|
234 |
} else {
|
| 219 |
Template template = Velocity.getTemplate(catalogId + File.separator + filename + ".vm");
|
235 |
Template template = Velocity.getTemplate(catalogId + File.separator + filename + ".vm");
|
| 220 |
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(exportPath + File.separator +filename+".html")));
|
236 |
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(exportPath + File.separator + filename +".html")));
|
| 221 |
template.merge(context, writer);
|
237 |
template.merge(context, writer);
|
| 222 |
writer.flush();
|
238 |
writer.flush();
|
| 223 |
writer.close();
|
239 |
writer.close();
|
| - |
|
240 |
}
|
| 224 |
}
|
241 |
}
|
| 225 |
}catch (ResourceNotFoundException e) {
|
242 |
}catch (ResourceNotFoundException e) {
|
| 226 |
// TODO Auto-generated catch block
|
243 |
// TODO Auto-generated catch block
|
| 227 |
e.printStackTrace();
|
244 |
e.printStackTrace();
|
| 228 |
} catch (IOException e) {
|
245 |
} catch (IOException e) {
|