forked from VCityTeam/UD-Viz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ContributeModule.js
41 lines (38 loc) · 1.88 KB
/
ContributeModule.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
33
34
35
36
37
38
39
40
41
import { DocumentModule } from "../../Modules/Documents/DocumentModule";
import { DocumentCreationWindow } from "./View/DocumentCreationWindow";
import { DocumentUpdateWindow } from "./View/DocumentUpdateWindow";
import { ContributeService } from "./Service/ContributeService";
import { RequestService } from "../../Utils/Request/RequestService";
import { DocumentDeletionInterface } from "./View/DocumentDeletionInterface";
/**
* This module is used to manage the update, deletion and creation of documents.
* It holds two windows that extend the document module, and creates a button
* for the document deletion.
*/
export class ContributeModule {
/**
* Constructs a new contribute module.
*
* @param {DocumentModule} documentModule The document module.
* @param {DocumentImageOrienter} documentImageOrienter The document image
* orienter module.
* @param {RequestService} requestService The request service.
* @param {*} itownsView The iTowns view.
* @param {*} cameraControls The planar camera controls.
* @param {object} config The UDV config.
* @param {object} config.server The server configuration.
* @param {string} config.server.url The server url.
* @param {string} config.server.document The base route for documents.
*/
constructor(documentModule, documentImageOrienter, requestService, itownsView, cameraControls, config) {
this.contributeService = new ContributeService(requestService,
documentModule.provider, config)
this.creationWindow = new DocumentCreationWindow(this.contributeService,
itownsView, cameraControls, documentImageOrienter);
this.updateWindow = new DocumentUpdateWindow(this.contributeService,
documentModule);
new DocumentDeletionInterface(documentModule, this.contributeService);
documentModule.addDocumentWindow(this.creationWindow);
documentModule.addDocumentWindow(this.updateWindow);
}
}