Subversion Repositories SmartDukaan

Rev

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

Rev 1165 Rev 1362
Line 122... Line 122...
122
		// Python wrapper for executing rule in python script
122
		// Python wrapper for executing rule in python script
123
		CMPJythonWrapper cmpJW = new CMPJythonWrapper();
123
		CMPJythonWrapper cmpJW = new CMPJythonWrapper();
124
		
124
		
125
		// Scores are required for parent slides only
125
		// Scores are required for parent slides only
126
		List<Slide> slides = entity.getSlides();
126
		List<Slide> slides = entity.getSlides();
-
 
127
		if(slides==null){
-
 
128
			return slideScores;
-
 
129
		}
127
		for(Slide slide : slides) {
130
		for(Slide slide : slides) {
128
			ExpandedSlide expSlide = new ExpandedSlide(slide);
131
			ExpandedSlide expSlide = new ExpandedSlide(slide);
129
			cmpJW.reset();
132
			cmpJW.reset();
130
			cmpJW.initialize();
133
			cmpJW.initialize();
131
			
134
			
Line 174... Line 177...
174
		for(Long entityID : slideScoresByEntity.keySet()) {
177
		for(Long entityID : slideScoresByEntity.keySet()) {
175
			Map<Long, Integer> slideScores = slideScoresByEntity.get(entityID);
178
			Map<Long, Integer> slideScores = slideScoresByEntity.get(entityID);
176
			
179
			
177
			Entity entity = CreationUtils.getEntity(entityID);
180
			Entity entity = CreationUtils.getEntity(entityID);
178
			long categoryID = entity.getCategoryID();
181
			long categoryID = entity.getCategoryID();
-
 
182
			if(categoryID == -1){
-
 
183
				continue;
179
			
184
			}
180
			List<CMPBucketDefinition> bucketDefs = 
185
			List<CMPBucketDefinition> bucketDefs = 
181
				defs.getComparisonBucketDefinitions(categoryID);
186
				defs.getComparisonBucketDefinitions(categoryID);
182
			
187
			
183
			Map<String, Integer> bucketScores = new HashMap<String, Integer>();
188
			Map<String, Integer> bucketScores = new HashMap<String, Integer>();
184
			Map<String, Integer> bucketSlideCounts = 
189
			Map<String, Integer> bucketSlideCounts = 
Line 235... Line 240...
235
			// Apply weights and sum up
240
			// Apply weights and sum up
236
			for(CMPBucketDefinition bucketDef : bucketDefs) {
241
			for(CMPBucketDefinition bucketDef : bucketDefs) {
237
				String bucketName = bucketDef.getName();
242
				String bucketName = bucketDef.getName();
238
				Utils.info("bucketName=" + bucketName);
243
				Utils.info("bucketName=" + bucketName);
239
				
244
				
-
 
245
				if(bucketScores.get(bucketName)==null){
-
 
246
					continue;
-
 
247
				}
240
				int aggregateBucketScore = bucketScores.get(bucketName);
248
				int aggregateBucketScore = bucketScores.get(bucketName);
241
				Utils.info("aggregateBucketScore=" + aggregateBucketScore);
249
				Utils.info("aggregateBucketScore=" + aggregateBucketScore);
242
				
250
				
243
				int bucketSlideCount = bucketSlideCounts.get(bucketName);
251
				int bucketSlideCount = bucketSlideCounts.get(bucketName);
244
				Utils.info("bucketSlideCount=" + bucketSlideCount);
252
				Utils.info("bucketSlideCount=" + bucketSlideCount);