@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
152 lines (151 loc) • 7.18 kB
JavaScript
// SPDX-License-Identifier: Apache-2.0
import ApplicationLifeCycleManager from '../tools/app/lifecyclemanager.js';
import AuthManager from '../tools/auth/authmanager.js';
import DragManager from '../components/treeview/tools/dragmanager.js';
import PluginManager from '../tools/auth/pluginmanager.js';
import ConfigManager from '../tools/configuration/configmanager.js';
import ErrorManager from '../tools/error/errormanager.js';
import I18nManager from '../tools/i18n/i18nmanager.js';
import LayerManager from '../tools/layers/layermanager.js';
import SnapManager from '../tools/layers/snapmanager.js';
import LocalFileManager from '../tools/localfile/localfilemanager.js';
import LogManager from '../tools/logging/logmanager.js';
import OfflineManager from '../tools/offline/offlinemanager.js';
import OgcApiFeaturesManager from '../tools/ogcapi/ogcapifeaturesmanager.js';
import OrderingManager from '../tools/ordering/orderingmanager.js';
import ShareManager from '../tools/share/sharemanager.js';
import StateSerializer from '../tools/share/stateserializer.js';
import ComponentManager from '../tools/state/componentManager.js';
import MapManager from '../tools/state/mapManager.js';
import StateManager from '../tools/state/statemanager.js';
import UserInteractionManager from '../tools/state/userInteractionManager.js';
import CustomThemesManager from '../tools/themes/customthemesmanager.js';
import ThemesHelper from '../tools/themes/themeshelper.js';
import ThemesManager from '../tools/themes/themesmanager.js';
import UserLayerManager from '../tools/themes/userlayermanager.js';
import PermalinkManager from '../tools/url/permalinkmanager.js';
import UrlManager from '../tools/url/urlmanager.js';
import UserDataManager from '../tools/userdata/userdatamanager.js';
import WfsManager from '../tools/wfs/wfsmanager.js';
import WmsManager from '../tools/wms/wmsmanager.js';
import ApiSessionManager from './apisessionmanager.js';
import OnBoardingManager from '../tools/onboarding/onboardingmanager.js';
import ThemeFavoritesManager from '../tools/themes/themefavoritesmanager.js';
import SearchManager from '../tools/search/searchmanager.js';
import FeedbackManager from '../tools/feedback/feedbackmanager.js';
import { updateConfigPaths } from './apiutils.js';
export default class GirafeApiContext {
userDataManager;
configManager;
stateManager;
componentManager;
userInteractionManager;
i18nManager;
pluginManager;
themesManager;
themesHelper;
permalinkManager;
urlManager;
dragManager;
layerManager;
sessionManager;
stateSerializer;
shareManager;
customThemesManager;
errorManager;
wfsManager;
authManager;
snapManager;
mapManager;
logManager;
offlineManager;
applicationLifeCycleManager;
orderingManager;
userLayerManager;
wmsManager;
ogcApiFeaturesManager;
localFileManager;
onBoardingManager;
themeFavoritesManager;
searchManager;
feedbackManager;
constructor() {
this.componentManager = new ComponentManager(this);
this.userDataManager = new UserDataManager(this);
this.configManager = new ConfigManager(this);
this.logManager = new LogManager(this);
this.stateManager = new StateManager(this);
this.orderingManager = new OrderingManager(this);
this.applicationLifeCycleManager = new ApplicationLifeCycleManager(this);
this.mapManager = new MapManager(this);
this.offlineManager = new OfflineManager(this);
this.snapManager = new SnapManager(this);
this.authManager = new AuthManager(this);
this.pluginManager = new PluginManager(this);
this.i18nManager = new I18nManager(this);
this.userInteractionManager = new UserInteractionManager(this);
this.dragManager = new DragManager(this);
this.urlManager = new UrlManager(this);
this.permalinkManager = new PermalinkManager(this);
this.layerManager = new LayerManager(this);
this.userLayerManager = new UserLayerManager(this);
this.themesHelper = new ThemesHelper(this);
this.stateSerializer = new StateSerializer(this);
this.sessionManager = new ApiSessionManager(this);
this.shareManager = new ShareManager(this);
this.wfsManager = new WfsManager(this);
this.errorManager = new ErrorManager(this);
this.customThemesManager = new CustomThemesManager(this);
this.themesManager = new ThemesManager(this);
this.wmsManager = new WmsManager(this);
this.localFileManager = new LocalFileManager(this);
this.ogcApiFeaturesManager = new OgcApiFeaturesManager(this);
this.onBoardingManager = new OnBoardingManager(this);
this.themeFavoritesManager = new ThemeFavoritesManager(this);
this.searchManager = new SearchManager(this);
this.feedbackManager = new FeedbackManager(this);
}
async initialize() {
// NOTE : This initialization order is important, because some singleton will need other ones !
this.componentManager.initializeSingleton();
this.userDataManager.initializeSingleton();
this.configManager.initializeSingleton();
await this.configManager.loadConfig();
// For the API context, some configuraton options in the config file can be relative.
// We have to convert them to absolute paths.
updateConfigPaths(this.configManager.Config);
this.logManager.initializeSingleton();
this.logManager.initLogging();
this.stateManager.initializeSingleton();
this.stateManager.state.interface.isApi = true;
this.orderingManager.initializeSingleton();
this.applicationLifeCycleManager.initializeSingleton();
this.mapManager.initializeSingleton();
this.offlineManager.initializeSingleton();
this.snapManager.initializeSingleton();
this.authManager.initializeSingleton();
this.pluginManager.initializeSingleton();
this.i18nManager.initializeSingleton();
this.userInteractionManager.initializeSingleton();
this.dragManager.initializeSingleton();
this.urlManager.initializeSingleton();
this.permalinkManager.initializeSingleton();
this.layerManager.initializeSingleton();
this.userLayerManager.initializeSingleton();
this.themesHelper.initializeSingleton();
this.stateSerializer.initializeSingleton();
this.sessionManager.initializeSingleton();
this.shareManager.initializeSingleton();
this.wfsManager.initializeSingleton();
this.errorManager.initializeSingleton();
this.customThemesManager.initializeSingleton();
this.themesManager.initializeSingleton();
this.wmsManager.initializeSingleton();
this.localFileManager.initializeSingleton();
this.ogcApiFeaturesManager.initializeSingleton();
this.onBoardingManager.initializeSingleton();
this.themeFavoritesManager.initializeSingleton();
this.searchManager.initializeSingleton();
this.feedbackManager.initializeSingleton();
}
}