Subversion Repositories SmartDukaan

Rev

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

Rev 516 Rev 580
Line 256... Line 256...
256
		xmlSnippets.add("\t</Properties>");
256
		xmlSnippets.add("\t</Properties>");
257
		
257
		
258
		xmlSnippets.add("\n\t<Categories>");
258
		xmlSnippets.add("\n\t<Categories>");
259
		
259
		
260
		// Iterate over all categories
260
		// Iterate over all categories
-
 
261
		/*
261
		Category rootCategory = defs.getCategory(10000);
262
		Category rootCategory = defs.getCategory(10000);
262
		List<Category> children = rootCategory.getChildrenCategory();
263
		List<Category> children = rootCategory.getChildrenCategory();
263
		for (Category child : children) {
264
		for (Category child : children) {
264
 
265
 
265
			String categoryXMLSnip = this.getCategoryXMLSnippet(child, 2);
266
			String categoryXMLSnip = this.getCategoryXMLSnippet(child, 2);
266
			Utils.info("categoryXMLSnip=" + categoryXMLSnip);
267
			Utils.info("categoryXMLSnip=" + categoryXMLSnip);
267
			
268
			
268
			xmlSnippets.add(categoryXMLSnip);
269
			xmlSnippets.add(categoryXMLSnip);
269
		}
270
		}
-
 
271
		*/
-
 
272
		
-
 
273
		Category rootCategory = defs.getCategory(10000);
-
 
274
		String categoryXMLSnip = this.getCategoryXMLSnippet(rootCategory, 2);
-
 
275
		Utils.info("categoryXMLSnip=" + categoryXMLSnip);
-
 
276
		
-
 
277
		xmlSnippets.add(categoryXMLSnip);
-
 
278
	
-
 
279
 
270
		xmlSnippets.add("\t</Categories>");
280
		xmlSnippets.add("\t</Categories>");
271
		
281
		
272
		// </IRMetaData>
282
		// </IRMetaData>
273
		xmlSnippets.add("</IRMetaData>");
283
		xmlSnippets.add("</IRMetaData>");
274
		
284
		
Line 417... Line 427...
417
		else {
427
		else {
418
			// Get all categories
428
			// Get all categories
419
			categories = defs.getChildrenCategories(10001);
429
			categories = defs.getChildrenCategories(10001);
420
		}
430
		}
421
		
431
		
-
 
432
		int i=0;
422
		for(Category cat : categories) {
433
		for(Category cat : categories) {
423
			long catID = cat.getID();
434
			long catID = cat.getID();
-
 
435
			if(i>0){
-
 
436
				continue;
424
			
437
			}
-
 
438
			i++;
425
			// Get all facets for the category
439
			// Get all facets for the category
426
			ExpandedCategoryFacetDefinition expCategoryFacetDef = 
440
			ExpandedCategoryFacetDefinition expCategoryFacetDef = 
427
				defs.getExpandedCategoryFacetDefinition(catID);
441
				defs.getExpandedCategoryFacetDefinition(catID);
428
			
442
			
429
			List<ExpandedFacetRuleDefinition> expFacetRuleDefs = 
443
			List<ExpandedFacetRuleDefinition> expFacetRuleDefs = 
Line 858... Line 872...
858
			
872
			
859
			Feature feature = 
873
			Feature feature = 
860
				ents.getFeature(expEntity.getID(), featureDef.getID());
874
				ents.getFeature(expEntity.getID(), featureDef.getID());
861
			
875
			
862
			// Special case for Brand
876
			// Special case for Brand
863
			if(expFacetRuleDef.getFacetDefinitionID() == 50001) {
877
			if(expFacetRuleDef.getFacetDefinitionID() == 50001 ||
-
 
878
			   expFacetRuleDef.getFacetDefinitionID() == 50010 ||
-
 
879
				expFacetRuleDef.getFacetDefinitionID() == 50011) {
864
				
880
				
865
				// Execute Python script
881
				// Execute Python script
866
				jw.executeRule();
882
				jw.executeRule();
867
				
883
				
868
			}
884
			}
Line 1114... Line 1130...
1114
		String entityID = new Long(expEntity.getID()).toString();
1130
		String entityID = new Long(expEntity.getID()).toString();
1115
		xmlSnippet.add(this.xmlIndentation[indent] + "<Entity ID=\""+ entityID + 
1131
		xmlSnippet.add(this.xmlIndentation[indent] + "<Entity ID=\""+ entityID + 
1116
				"\">");
1132
				"\">");
1117
 
1133
 
1118
		//<Category>Business Phones</Category>
1134
		//<Category>Business Phones</Category>
1119
		String category = expEntity.getCategory().getLabel();
1135
		String parentCategory = expEntity.getCategory().getLabel();
1120
		xmlSnippet.add(this.xmlIndentation[indent + 1] + "<Category>" + 
1136
		xmlSnippet.add(this.xmlIndentation[indent + 1] + "<Category>" + 
1121
				StringEscapeUtils.escapeXml(category) + "</Category>");
1137
				StringEscapeUtils.escapeXml(parentCategory) + "</Category>");
1122
 
1138
 
-
 
1139
		/*
-
 
1140
		//<Category>Business Phones</Category>
-
 
1141
		String category = expEntity.getCategory().getLabel();
-
 
1142
		xmlSnippet.add(this.xmlIndentation[indent + 1] + "<SubCategory>" + 
-
 
1143
				StringEscapeUtils.escapeXml(category) + "</SubCategory>");
-
 
1144
		 */
-
 
1145
		
1123
		//<Title>Nokia E71</Title>
1146
		//<Title>Nokia E71</Title>
1124
		String title = StringEscapeUtils.escapeXml(expEntity.getBrand()) + " " +
1147
		String title = StringEscapeUtils.escapeXml(expEntity.getBrand()) + " " +
1125
		StringEscapeUtils.escapeXml(expEntity.getModelName()) + 
1148
		StringEscapeUtils.escapeXml(expEntity.getModelName()) + 
1126
			((expEntity.getModelNumber() != null) ? 
1149
			((expEntity.getModelNumber() != null) ? 
1127
					(" " + 
1150
					(" " +