1 | package org.greenstone.atea.morphia;
|
---|
2 |
|
---|
3 | import dev.morphia.annotations.*;
|
---|
4 | import java.util.ArrayList;
|
---|
5 | import java.util.List;
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * Morphia provides the Object Document Mapper for MongoDB
|
---|
9 | * https://www.baeldung.com/mongodb-morphia
|
---|
10 | *
|
---|
11 | */
|
---|
12 | @Entity("Webpages")
|
---|
13 | public class WebpageInfo {
|
---|
14 |
|
---|
15 | /** db table ids */
|
---|
16 | @Id
|
---|
17 | public final long webpageID;
|
---|
18 | // TODO: should this be a "Reference" to the WebsiteInfo object instead?
|
---|
19 | // See section 5.2 of https://www.baeldung.com/mongodb-morphia
|
---|
20 | public final String websiteID; //int websiteID;
|
---|
21 |
|
---|
22 | public final int totalSentences;
|
---|
23 |
|
---|
24 | public final String text;
|
---|
25 | public final String URL;
|
---|
26 | public final boolean isMRI;
|
---|
27 |
|
---|
28 | public final String charEncoding;
|
---|
29 | public final String modifiedTime;
|
---|
30 | public final String fetchTime;
|
---|
31 |
|
---|
32 | @Embedded
|
---|
33 | public final List<SentenceInfo> singleSentences;
|
---|
34 | @Embedded
|
---|
35 | public final List<SentenceInfo> overlappingSentences;
|
---|
36 |
|
---|
37 | private int mriSentenceCount;
|
---|
38 | private boolean containsMRI;
|
---|
39 |
|
---|
40 | public WebpageInfo (long webpageID, String siteID/*int websiteID,*/,
|
---|
41 | String pageText, String pageURL, boolean isMRI, int totalSentences,
|
---|
42 | String charEncoding, String modifiedTime, String fetchTime,
|
---|
43 | List<SentenceInfo> singleSentences,
|
---|
44 | List<SentenceInfo> overlappingSentences)
|
---|
45 | {
|
---|
46 |
|
---|
47 | this.webpageID = webpageID;
|
---|
48 | //this.websiteID = websiteID;
|
---|
49 | this.websiteID = siteID;
|
---|
50 |
|
---|
51 | this.totalSentences = totalSentences;
|
---|
52 |
|
---|
53 | this.text = pageText;
|
---|
54 | this.URL = pageURL;
|
---|
55 | this.isMRI = isMRI;
|
---|
56 |
|
---|
57 | this.charEncoding = charEncoding;
|
---|
58 | this.modifiedTime = modifiedTime;
|
---|
59 | this.fetchTime = fetchTime;
|
---|
60 |
|
---|
61 | this.singleSentences = singleSentences;
|
---|
62 | this.overlappingSentences = overlappingSentences;
|
---|
63 |
|
---|
64 | }
|
---|
65 |
|
---|
66 | public void setMRISentenceCount(int count) {
|
---|
67 | this.mriSentenceCount = count;
|
---|
68 | }
|
---|
69 | public void setContainsMRI(boolean containsMRI) {
|
---|
70 | this.containsMRI = containsMRI;
|
---|
71 | }
|
---|
72 |
|
---|
73 | public int getMRISentenceCount() { return this.mriSentenceCount; }
|
---|
74 | }
|
---|