Subversion Repositories SmartDukaan

Rev

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

Rev 3719 Rev 3829
Line 4... Line 4...
4
import in.shop2020.metamodel.core.Entity;
4
import in.shop2020.metamodel.core.Entity;
5
import in.shop2020.metamodel.core.Feature;
5
import in.shop2020.metamodel.core.Feature;
6
import in.shop2020.metamodel.core.Media;
6
import in.shop2020.metamodel.core.Media;
7
import in.shop2020.metamodel.core.PrimitiveDataObject;
7
import in.shop2020.metamodel.core.PrimitiveDataObject;
8
import in.shop2020.metamodel.definitions.Catalog;
8
import in.shop2020.metamodel.definitions.Catalog;
-
 
9
import in.shop2020.metamodel.definitions.Category;
9
import in.shop2020.metamodel.util.CreationUtils;
10
import in.shop2020.metamodel.util.CreationUtils;
10
import in.shop2020.metamodel.util.ExpandedBullet;
11
import in.shop2020.metamodel.util.ExpandedBullet;
11
import in.shop2020.metamodel.util.ExpandedEntity;
12
import in.shop2020.metamodel.util.ExpandedEntity;
12
import in.shop2020.metamodel.util.ExpandedFeature;
13
import in.shop2020.metamodel.util.ExpandedFeature;
13
import in.shop2020.metamodel.util.ExpandedSlide;
14
import in.shop2020.metamodel.util.ExpandedSlide;
Line 273... Line 274...
273
            }
274
            }
274
        }
275
        }
275
 
276
 
276
        try {
277
        try {
277
            JSONObject props = new JSONObject();
278
            JSONObject props = new JSONObject();
-
 
279
            Category category = expEntity.getCategory();
-
 
280
            String categoryName = category.getLabel();
-
 
281
            
278
            props.put("metaDescription", metaDescription);
282
            props.put("metaDescription", metaDescription);
279
            props.put("metaKeywords", metaKeywords);
283
            props.put("metaKeywords", metaKeywords);
280
            props.put("entityUrl", entityUrl);
284
            props.put("entityUrl", entityUrl);
281
            props.put("title", title);
285
            props.put("title", title);
282
            props.put("name", EntityUtils.getProductName(expEntity));
286
            props.put("name", EntityUtils.getProductName(expEntity));
-
 
287
            boolean displayAccessories;
283
            if(expEntity.getCategory().getParentCategory().getID() != Utils.MOBILE_ACCESSORIES_CATEGORY && expEntity.getCategory().getID() != Utils.LAPTOPS_CATEGORY){
288
            if(expEntity.getCategory().getParentCategory().getID() != Utils.MOBILE_ACCESSORIES_CATEGORY && expEntity.getCategory().getID() != Utils.LAPTOPS_CATEGORY){
284
            	props.put("displayAccessories", "TRUE");	
289
            	props.put("displayAccessories", "TRUE");
-
 
290
            	displayAccessories = true;
285
    		}else{
291
    		}else{
286
    			props.put("displayAccessories", "FALSE" );
292
    			props.put("displayAccessories", "FALSE" );
-
 
293
    			displayAccessories = false;
287
    		}   
294
    		}   
288
            
295
            
-
 
296
            props.put("categoryName", categoryName);
-
 
297
            props.put("categoryUrl", categoryName.replaceAll(" ", "-").toLowerCase() + "/" + category.getID());
-
 
298
            String categoryUrl = categoryName.replaceAll(" ", "-").toLowerCase() + "/" + category.getID();
-
 
299
            
-
 
300
            String brandUrl = expEntity.getBrand().toLowerCase().replace(' ', '-');
-
 
301
            
-
 
302
            String breadCrumb = "<a href='/'>Home</a>&nbsp;&gt;&nbsp;" + 
-
 
303
								"<a href='/" +  categoryUrl + "'>" + categoryName + "</a>&nbsp;&gt;&nbsp;";
-
 
304
            if(displayAccessories){
-
 
305
            	breadCrumb = breadCrumb +  "<a href='/" + brandUrl + "'>" + expEntity.getBrand() + "</a>";
-
 
306
            }else{
-
 
307
            	breadCrumb =  breadCrumb + "<a>" + expEntity.getBrand() + "</a>";	
-
 
308
            }
-
 
309
            breadCrumb = breadCrumb +  "&nbsp;<a>" + expEntity.getModelName().trim() + " " + expEntity.getModelNumber().trim() + "</a>";
-
 
310
            props.put("breadCrumb", breadCrumb);
-
 
311
          
289
            
312
            
290
            String exportFileName = exportPath + catalogId + File.separator
313
            String exportFileName = exportPath + catalogId + File.separator
291
                    + "ProductPropertiesSnippet.vm";
314
                    + "ProductPropertiesSnippet.vm";
292
            File exportFile = new File(exportFileName);
315
            File exportFile = new File(exportFileName);
293
            if (!exportFile.exists()) {
316
            if (!exportFile.exists()) {