8#pragma warning(disable : 4251)
30 namespace components {
39 class ModalCommandBase;
40 class AbstractUiNotifier;
41 class AbstractSettingsItem;
42 class AbstractModelNotifier;
56 virtual void run(
void) = 0;
121 virtual std::string deploymentPath(
void)
const;
135 void setSiteID(
const std::string & _id) { m_siteID = _id; }
143 void setDirectoryServiceURL(
const std::string& _url);
147 void setSessionServiceURL(
const std::string & _url);
151 void setSessionID(
const std::string & _id);
166 std::string
siteID(
void) {
return m_siteID; }
181 const std::string&
projectType(
void)
const {
return m_projectType; };
205 ServiceBase * getConnectedServiceByName(
const std::string & _name);
223 std::string processActionWithModalCommands(
const std::string & _action,
JsonDocument& _doc);
233 void enableMessageQueuing(
const std::string & _serviceName,
bool _flag);
237 void flushQueuedHttpRequests(
const std::string & _serviceName);
244 bool sendMessage(
bool _queue,
const std::string & _serviceName,
const JsonDocument& _doc, std::string& _response);
252 bool sendMessage(
bool _queue,
const std::string & _serviceName,
const JsonDocument& _doc, std::list<std::pair<UID, UID>> & _prefetchIds, std::string& _response);
257 bool broadcastMessage(
bool _queue,
const std::string& _message);
262 bool broadcastMessage(
bool _queue,
const JsonDocument& _doc);
264 void prefetchDocumentsFromStorage(
const std::list<UID> &entities);
265 void prefetchDocumentsFromStorage(
const std::list<ot::EntityInformation> &entityInfo);
266 UID getPrefetchedEntityVersion(
UID entityID);
269 std::string getLogInUserName()
const;
270 std::string getLogInUserPsw()
const;
275 bool EnsureDataBaseConnection(
void);
277 bool storeSettingToDataBase(
const PropertyGridCfg& _config,
const std::string& _databaseURL,
const std::string& _siteID,
const std::string& _userName,
const std::string& _userPassword,
const std::string& _userCollection);
279 PropertyGridCfg getSettingsFromDataBase(
const std::string& _databaseURL,
const std::string& _siteID,
const std::string& _userName,
const std::string& _userPassword,
const std::string& _userCollection);
319 void __serviceConnected(
const std::string& _name,
const std::string& _type,
const std::string& _url,
serviceID_t _id);
327 void __serviceDisconnected(
const std::string & _name,
const std::string & _type,
const std::string & _url,
serviceID_t _id);
329 void __shuttingDown(
bool _requestedAsCommand);
331 std::string m_DBuserCollection;
332 ClassFactory classFactory;
#define OT_HANDLER(___functionName, ___className, ___actionName, ___messageTypeFlags)
Creates a function that will be registered in the dispatch system. The generated function will look l...
Definition ActionHandleConnector.h:26
#define OT_ACTION_CMD_KeySequenceActivated
Definition ActionTypes.h:81
#define OT_ACTION_CMD_UI_SettingsItemChanged
Definition ActionTypes.h:169
#define OT_SERVICEFOUNDATION_API_EXPORT
Definition FoundationAPIExport.h:7
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
Definition ExternalServicesComponent.h:62
Definition AbstractModelNotifier.h:11
Definition AbstractUiNotifier.h:11
Definition ActionHandler.h:14
Definition ApplicationBase.h:45
virtual void settingsSynchronized(const PropertyGridCfg &_config)=0
This function will be called when the settings were synchronized with the database....
std::string webSocketURL(void)
Will return the websocket URL, it is only set if a websocket was required on startup: startAsRelaySer...
Definition ApplicationBase.h:169
virtual void run(void)=0
Will be called when the service was successfully started, the hppt and/or websocket connection is est...
std::string m_collectionName
Definition ApplicationBase.h:310
virtual void shuttingDown(void)=0
Will be called when the application is shutting down (shut down can not be stopped) At this point all...
std::map< std::string, structServiceInformation > m_serviceNameMap
Definition ApplicationBase.h:293
virtual void modelDisconnected(const components::ModelComponent *_serviceInfo)=0
Will be called when a mode service disconnected from the session (is already closed)
structServiceInformation m_sessionService
Definition ApplicationBase.h:297
virtual bool startAsRelayService(void) const =0
Will return true if this application requires a relay service for a websocket connection.
virtual void preShutdown(void)=0
Will be called before the whole session starts to shut down (shut down can not be stopped) At this po...
const std::string & getCollectionName() const
Definition ApplicationBase.h:183
ClassFactory & getClassFactory(void)
Returns a handle to the global class factory for the service.
Definition ApplicationBase.h:214
void setDataBaseURL(const std::string &_url)
Will set the database URL of the database this application is using.
Definition ApplicationBase.h:131
std::string m_databaseURL
Definition ApplicationBase.h:304
std::string m_projectName
Definition ApplicationBase.h:309
components::UiComponent * uiComponent(void) const
Will return the ui component used in this application The UI component only exists when a ui service ...
Definition ApplicationBase.h:197
virtual void uiDisconnected(const components::UiComponent *_serviceInfo)=0
Will be called when a UI disconnected from the session (is already closed)
components::UiComponent * m_uiComponent
Definition ApplicationBase.h:300
virtual std::string processMessage(ServiceBase *_sender, const std::string &_message, JsonDocument &_doc)=0
Will be called whenever a message should be processed. Core messages will be processed in the base an...
virtual void modelSelectionChanged(void)
Definition ApplicationBase.h:123
bool m_uiMessageQueuingEnabled
Definition ApplicationBase.h:285
std::string dataBaseURL(void)
Will return the URL of the database.
Definition ApplicationBase.h:163
virtual void serviceDisconnected(const ServiceBase *_service)=0
Will be called when a service is disconnected from the session (is already closed) (UI and model serv...
bool isModelConnected(void) const
Will return true if a model service is running in the session.
Definition ApplicationBase.h:189
const std::string & projectType(void) const
The current project type.
Definition ApplicationBase.h:181
components::ModelComponent * modelComponent(void) const
Will return the model component used in this application The model component only exists when a model...
Definition ApplicationBase.h:193
virtual PropertyGridCfg createSettings(void) const =0
Create settings that your application uses that are editable in the uiService. The created class will...
bool isUiConnected(void) const
Will return true if a UI is running in the session.
Definition ApplicationBase.h:186
virtual void modelConnected(components::ModelComponent *_model)=0
Will be called when a model service connected to the session and is ready to work.
virtual void uiConnected(components::UiComponent *_ui)=0
Will be called when a UI connected to the session and is ready to work.
void setSiteID(const std::string &_id)
Will set the site ID this application is running on.
Definition ApplicationBase.h:135
virtual void serviceConnected(ServiceBase *_service)=0
Will be called when a service is connected to the session (UI and model services will not trigger thi...
std::list< ot::ModalCommandBase * > m_modalCommands
Definition ApplicationBase.h:313
std::string m_siteID
Definition ApplicationBase.h:305
components::ModelComponent * m_modelComponent
Definition ApplicationBase.h:299
std::string m_websocketURL
Definition ApplicationBase.h:306
std::string m_projectType
Definition ApplicationBase.h:311
virtual std::string processAction(const std::string &_action, JsonDocument &_doc)=0
Will be called whenever a action should be processed. Core actions will be processed in the base and ...
std::string directoryServiceURL(void)
Will return the local directory service URL.
Definition ApplicationBase.h:175
std::list< UID > m_selectedEntities
Definition ApplicationBase.h:315
std::map< UID, UID > m_prefetchedEntityVersions
Definition ApplicationBase.h:317
void setWebSocketURL(const std::string &_url)
Will set the websocket URL that this application is connected to (only required if socket connection ...
Definition ApplicationBase.h:139
std::string m_sessionID
Definition ApplicationBase.h:308
AbstractModelNotifier * m_modelNotifier
Definition ApplicationBase.h:302
AbstractUiNotifier * m_uiNotifier
Definition ApplicationBase.h:301
std::string siteID(void)
Will return the site ID this application is running on.
Definition ApplicationBase.h:166
AbstractModelNotifier * modelNotifier(void)
Will return the modelNotifier attached to this application.
Definition ApplicationBase.h:211
AbstractUiNotifier * uiNotifier(void)
Will return the uiNotifier attached to this application.
Definition ApplicationBase.h:208
structServiceInformation m_directoryService
Definition ApplicationBase.h:298
std::string sessionID(void)
Will return the session ID this service is running in.
Definition ApplicationBase.h:178
std::string sessionServiceURL(void)
Will return the session service URL.
Definition ApplicationBase.h:172
std::map< serviceID_t, structServiceInformation > m_serviceIdMap
Definition ApplicationBase.h:295
virtual bool settingChanged(const Property *_property)=0
This function will be called when the settings were changed in the uiService. The value of the provid...
void setProjectType(const std::string &_type)
Set the project type.
Definition ApplicationBase.h:154
JSON document.
Definition JSON.h:276
Definition ModalCommandBase.h:18
Definition PropertyGridCfg.h:21
The Property class is used as a base class for all Properties that can be displayed and modified in t...
Definition Property.h:21
General service information. The ServiceBase class is used to store the general service information.
Definition ServiceBase.h:24
Definition ModelComponent.h:42
Definition UiComponent.h:31
This is the main class interacting with external services. Use the static instance() function to get ...
Definition ExternalServicesComponent.h:27
Definition GraphicsPicker.cpp:29
@ SECURE_MESSAGE_TYPES
Definition CommunicationTypes.h:14
unsigned long UID
Unique identifier (32 bit unsigned integer)
Definition CoreTypes.h:27
unsigned short serviceID_t
ID type used to identify a service (16 bit unsigned integer).
Definition CoreTypes.h:14