Subversion Repositories SmartDukaan

Rev

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

Rev 344 Rev 457
Line 10... Line 10...
10
import in.shop2020.metamodel.util.ExpandedEntity;
10
import in.shop2020.metamodel.util.ExpandedEntity;
11
import in.shop2020.metamodel.util.ExpandedSlide;
11
import in.shop2020.metamodel.util.ExpandedSlide;
12
import in.shop2020.util.DBUtils;
12
import in.shop2020.util.DBUtils;
13
import in.shop2020.util.Utils;
13
import in.shop2020.util.Utils;
14
 
14
 
-
 
15
import java.io.File;
15
import java.io.Serializable;
16
import java.io.Serializable;
16
import java.util.ArrayList;
17
import java.util.ArrayList;
17
import java.util.HashMap;
18
import java.util.HashMap;
18
import java.util.List;
19
import java.util.List;
19
import java.util.Map;
20
import java.util.Map;
Line 78... Line 79...
78
	 */
79
	 */
79
	@SuppressWarnings("unchecked")
80
	@SuppressWarnings("unchecked")
80
	public Map<Long, Entity> getEntities() throws Exception {
81
	public Map<Long, Entity> getEntities() throws Exception {
81
		// De-serialize
82
		// De-serialize
82
		if(this.entities == null) {
83
		if(this.entities == null) {
83
			String entitiesDBFile = Utils.ENTITIES_DB_PATH + "entities.ser";
84
			String entitiesDBFile = Utils.CONTENT_DB_PATH + "entities" + File.separator + "entities.ser";
84
			String entitiesbycategoryDBFile = Utils.ENTITIES_DB_PATH + 
85
			String entitiesbycategoryDBFile = Utils.CONTENT_DB_PATH + "entities" + File.separator + 
85
				"entitiesbycategory.ser";
86
				"entitiesbycategory.ser";
86
			
87
			
87
			this.entities = (Map<Long, Entity>) DBUtils.read(entitiesDBFile);
88
			this.entities = (Map<Long, Entity>) DBUtils.read(entitiesDBFile);
88
			this.entitiesbycategory = (Map<Long, List<Entity>>) 
89
			this.entitiesbycategory = (Map<Long, List<Entity>>) 
89
				DBUtils.read(entitiesbycategoryDBFile);
90
				DBUtils.read(entitiesbycategoryDBFile);
Line 106... Line 107...
106
	 */
107
	 */
107
	@SuppressWarnings("unchecked")
108
	@SuppressWarnings("unchecked")
108
	public Map<Long, List<ExpandedBullet>> getLearnedBullets() throws Exception{
109
	public Map<Long, List<ExpandedBullet>> getLearnedBullets() throws Exception{
109
		// De-serialize
110
		// De-serialize
110
		if(this.learnedBullets == null) {
111
		if(this.learnedBullets == null) {
111
			String dbFile = Utils.ENTITIES_DB_PATH + "learnedbullets.ser";
112
			String dbFile = Utils.CONTENT_DB_PATH + "entities" + File.separator + "learnedbullets.ser";
112
			
113
			
113
			this.learnedBullets = 
114
			this.learnedBullets = 
114
				(Map<Long, List<ExpandedBullet>>) DBUtils.read(dbFile);
115
				(Map<Long, List<ExpandedBullet>>) DBUtils.read(dbFile);
115
		}
116
		}
116
		
117
		
Line 283... Line 284...
283
	 */
284
	 */
284
	@SuppressWarnings("unchecked")
285
	@SuppressWarnings("unchecked")
285
	public Map<Long, List<String>> getFacetValues() throws Exception {
286
	public Map<Long, List<String>> getFacetValues() throws Exception {
286
		// De-serialize
287
		// De-serialize
287
		if(this.facetDefinitionIDFacetValues == null) {
288
		if(this.facetDefinitionIDFacetValues == null) {
288
			String dbFile = Utils.ENTITIES_DB_PATH + "facetvalues.ser";
289
			String dbFile = Utils.CONTENT_DB_PATH + "entities" + File.separator + "facetvalues.ser";
289
			
290
			
290
			this.facetDefinitionIDFacetValues = 
291
			this.facetDefinitionIDFacetValues = 
291
				(Map<Long, List<String>>) DBUtils.read(dbFile);
292
				(Map<Long, List<String>>) DBUtils.read(dbFile);
292
		}
293
		}
293
		
294
		
Line 500... Line 501...
500
	@SuppressWarnings("unchecked")
501
	@SuppressWarnings("unchecked")
501
	public Map<Long, Map<Long, Integer>> getEntitySlideComparisonScores() 
502
	public Map<Long, Map<Long, Integer>> getEntitySlideComparisonScores() 
502
		throws Exception {
503
		throws Exception {
503
		// De-serialize
504
		// De-serialize
504
		if(this.entityIDSlideIDsScore == null) {
505
		if(this.entityIDSlideIDsScore == null) {
505
			String dbFile = Utils.COMPARISONS_DB_PATH + "slidescores.ser";
506
			String dbFile = Utils.CONTENT_DB_PATH + "comparisons" + File.separator + "slidescores.ser";
506
			
507
			
507
			this.entityIDSlideIDsScore = 
508
			this.entityIDSlideIDsScore = 
508
				(Map<Long, Map<Long, Integer>>) DBUtils.read(dbFile);
509
				(Map<Long, Map<Long, Integer>>) DBUtils.read(dbFile);
509
		}
510
		}
510
		
511
		
Line 524... Line 525...
524
	 */
525
	 */
525
	@SuppressWarnings("unchecked")
526
	@SuppressWarnings("unchecked")
526
	public Map<Long, Integer> getEntityComparisonScores() throws Exception {
527
	public Map<Long, Integer> getEntityComparisonScores() throws Exception {
527
		// De-serialize
528
		// De-serialize
528
		if(this.entityIDFinalScore == null) {
529
		if(this.entityIDFinalScore == null) {
529
			String dbFile = Utils.COMPARISONS_DB_PATH + 
530
			String dbFile = Utils.CONTENT_DB_PATH + "comparisons" + File.separator + 
530
				"defaultentityscores.ser";
531
				"defaultentityscores.ser";
531
			
532
			
532
			this.entityIDFinalScore = 
533
			this.entityIDFinalScore = 
533
				(Map<Long, Integer>) DBUtils.read(dbFile);
534
				(Map<Long, Integer>) DBUtils.read(dbFile);
534
		}
535
		}