| 8749 |
amit.gupta |
1 |
package in.shop2020.storage.mongo;
|
|
|
2 |
|
|
|
3 |
import in.shop2020.metamodel.definitions.Catalog;
|
|
|
4 |
|
|
|
5 |
import com.mongodb.DB;
|
|
|
6 |
import com.mongodb.DBCollection;
|
|
|
7 |
|
|
|
8 |
public class ContentViews {
|
|
|
9 |
private static ContentViews contentViews;
|
|
|
10 |
|
|
|
11 |
public DBCollection entity;
|
|
|
12 |
public DBCollection entityMetadata;
|
|
|
13 |
public DBCollection helpdoc;
|
|
|
14 |
public DBCollection specialPages;
|
|
|
15 |
public DBCollection tag;
|
|
|
16 |
public DBCollection synonyms;
|
|
|
17 |
public DBCollection inconsistentEntities;
|
|
|
18 |
public DBCollection learnedBullets;
|
|
|
19 |
public DBCollection defaultEntityScores;
|
|
|
20 |
public DBCollection facetValues;
|
|
|
21 |
public DBCollection slideScores;
|
|
|
22 |
public DBCollection customSlideScores;
|
|
|
23 |
public DBCollection contentGenerationTime;
|
|
|
24 |
public DBCollection helpdocEntityIds;
|
|
|
25 |
public DBCollection relatedAccessories;
|
|
|
26 |
public DBCollection comparisonStats;
|
|
|
27 |
public DBCollection searchStats;
|
|
|
28 |
public DBCollection expertReviews;
|
|
|
29 |
public DBCollection expertReviewSource;
|
| 9218 |
amit.gupta |
30 |
public DBCollection siteContent;
|
|
|
31 |
public DBCollection siteCatalog;
|
| 8749 |
amit.gupta |
32 |
/**
|
|
|
33 |
* Create the data bindings and collection views.
|
|
|
34 |
*/
|
|
|
35 |
private ContentViews(DB db) {
|
|
|
36 |
entity = db.getCollection("entity");
|
|
|
37 |
entityMetadata = db.getCollection("entityMetadata");
|
|
|
38 |
helpdoc = db.getCollection("helpdoc");
|
|
|
39 |
specialPages = db.getCollection("specialPages");
|
|
|
40 |
tag = db.getCollection("tag");
|
|
|
41 |
synonyms = db.getCollection("synonyms");
|
|
|
42 |
inconsistentEntities = db.getCollection("inconsistentEntities");
|
|
|
43 |
learnedBullets = db.getCollection("learnedBullets");
|
|
|
44 |
defaultEntityScores = db.getCollection("defaultEntityScores");
|
|
|
45 |
facetValues = db.getCollection("facetValues");
|
|
|
46 |
slideScores = db.getCollection("slideScores");
|
|
|
47 |
customSlideScores = db.getCollection("customSlideScores");
|
|
|
48 |
contentGenerationTime = db.getCollection("contentGenerationTime");
|
|
|
49 |
helpdocEntityIds = db.getCollection("helpdocEntityIds");
|
|
|
50 |
relatedAccessories = db.getCollection("relatedAccessories");
|
|
|
51 |
comparisonStats = db.getCollection("comparisonStats");
|
|
|
52 |
searchStats = db.getCollection("searchStats");
|
|
|
53 |
expertReviews = db.getCollection("expertReviews");
|
|
|
54 |
expertReviewSource = db.getCollection("expertReviewSource");
|
| 9218 |
amit.gupta |
55 |
siteContent = db.getCollection("siteContent");
|
|
|
56 |
siteCatalog = db.getCollection("siteCatalog");
|
| 8749 |
amit.gupta |
57 |
}
|
|
|
58 |
|
|
|
59 |
/**
|
|
|
60 |
*
|
|
|
61 |
* @return Catalog single instance of Catalog
|
|
|
62 |
*/
|
|
|
63 |
public static final ContentViews getInstance(DB db) {
|
|
|
64 |
if(contentViews == null){
|
|
|
65 |
contentViews = new ContentViews(db);
|
|
|
66 |
return contentViews;
|
|
|
67 |
}
|
|
|
68 |
else return contentViews;
|
|
|
69 |
}
|
|
|
70 |
|
|
|
71 |
// The views returned below can be accessed using the java.util.Map or
|
|
|
72 |
// java.util.Set interfaces, or using the StoredMap and StoredEntrySet
|
|
|
73 |
// classes, which provide additional methods. The entry sets could be
|
|
|
74 |
// obtained directly from the Map.entrySet() method, but convenience
|
|
|
75 |
// methods are provided here to return them in order to avoid down-casting
|
|
|
76 |
// elsewhere.
|
|
|
77 |
|
|
|
78 |
/**
|
|
|
79 |
* Return a map view of the entity storage container.
|
|
|
80 |
*/
|
|
|
81 |
}
|