forked from VCityTeam/UD-Viz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DocumentCommentsModule.js
32 lines (29 loc) · 1.36 KB
/
DocumentCommentsModule.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { DocumentCommentsService } from "./services/DocumentCommentsService";
import { DocumentModule } from "../../Modules/Documents/DocumentModule";
import { RequestService } from "../../Utils/Request/RequestService";
import { DocumentCommentsWindow } from "./views/DocumentCommentsWindow";
/**
* The class that represents the document comments module. It contains a
* service that performs HTTP requests and a window that extends the interface
* for documents.
*/
export class DocumentCommentsModule {
/**
* Creates the document comments module. Creates a service and a comments
* window.
*
* @param {DocumentModule} documentModule The document module.
* @param {RequestService} requestService The request service.
* @param {object} config The UDV config.
* @param {object} config.server The server access config.
* @param {string} config.server.url The server URL.
* @param {string} config.server.document The route for documents.
* @param {string} config.server.comment The route for comments.
* @param {string} config.server.user The route for users.
*/
constructor(documentModule, requestService, config) {
this.service = new DocumentCommentsService(documentModule.provider, requestService, config);
this.commentsWindow = new DocumentCommentsWindow(this.service);
documentModule.addDocumentWindow(this.commentsWindow);
}
}