| Line 5... |
Line 5... |
| 5 |
|
5 |
|
| 6 |
import in.shop2020.metamodel.core.Entity;
|
6 |
import in.shop2020.metamodel.core.Entity;
|
| 7 |
import in.shop2020.metamodel.core.Slide;
|
7 |
import in.shop2020.metamodel.core.Slide;
|
| 8 |
import in.shop2020.metamodel.definitions.CMPBucketDefinition;
|
8 |
import in.shop2020.metamodel.definitions.CMPBucketDefinition;
|
| 9 |
import in.shop2020.metamodel.definitions.Catalog;
|
9 |
import in.shop2020.metamodel.definitions.Catalog;
|
| - |
|
10 |
import in.shop2020.metamodel.definitions.Category;
|
| 10 |
import in.shop2020.metamodel.definitions.DefinitionsContainer;
|
11 |
import in.shop2020.metamodel.definitions.DefinitionsContainer;
|
| 11 |
import in.shop2020.metamodel.util.CreationUtils;
|
12 |
import in.shop2020.metamodel.util.CreationUtils;
|
| 12 |
import in.shop2020.metamodel.util.ExpandedCMPSlideRuleDefinition;
|
13 |
import in.shop2020.metamodel.util.ExpandedCMPSlideRuleDefinition;
|
| 13 |
import in.shop2020.metamodel.util.ExpandedEntity;
|
14 |
import in.shop2020.metamodel.util.ExpandedEntity;
|
| 14 |
import in.shop2020.metamodel.util.ExpandedSlide;
|
15 |
import in.shop2020.metamodel.util.ExpandedSlide;
|
| Line 83... |
Line 84... |
| 83 |
Map<Long, Map<Long, Double>> slideScoresByEntityID =
|
84 |
Map<Long, Map<Long, Double>> slideScoresByEntityID =
|
| 84 |
new TreeMap<Long, Map<Long, Double>>();
|
85 |
new TreeMap<Long, Map<Long, Double>>();
|
| 85 |
|
86 |
|
| 86 |
for(Entity entity : entities) {
|
87 |
for(Entity entity : entities) {
|
| 87 |
// Skip categories with value as -1 or categories except mobile phones and tablets
|
88 |
// Skip categories with value as -1 or categories except mobile phones and tablets
|
| 88 |
long parentCategoryId = Catalog.getInstance().getDefinitionsContainer().getCategory(entity.getCategoryID()).getParentCategory().getID();
|
89 |
long categoryId = entity.getCategoryID();
|
| 89 |
if(entity.getCategoryID() == -1 || parentCategoryId == Utils.MOBILE_ACCESSORIES_CATEGORY) {
|
90 |
if(categoryId == -1){
|
| 90 |
continue;
|
91 |
continue;
|
| 91 |
}
|
92 |
}
|
| 92 |
ExpandedEntity expEntity = new ExpandedEntity(entity);
|
- |
|
| 93 |
Map<Long, Double> slideScores = this.getSlideScores(expEntity);
|
93 |
Category parentCategory = Catalog.getInstance().getDefinitionsContainer().getCategory(categoryId).getParentCategory();
|
| 94 |
|
94 |
|
| - |
|
95 |
if(parentCategory.isComparable()) {
|
| - |
|
96 |
ExpandedEntity expEntity = new ExpandedEntity(entity);
|
| - |
|
97 |
|
| - |
|
98 |
Map<Long, Double> slideScores = this.getSlideScores(expEntity);
|
| 95 |
slideScoresByEntityID.put(entity.getID(), slideScores);
|
99 |
slideScoresByEntityID.put(entity.getID(), slideScores);
|
| - |
|
100 |
}
|
| 96 |
}
|
101 |
}
|
| 97 |
|
102 |
|
| 98 |
return slideScoresByEntityID;
|
103 |
return slideScoresByEntityID;
|
| 99 |
}
|
104 |
}
|
| 100 |
|
105 |
|