@magic-xpa/engine 4.1100.0-dev4110.98 → 4.1100.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -7
- package/{esm2020 → esm2022}/index.mjs +188 -188
- package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
- package/esm2022/src/AccessHelper.mjs +15 -0
- package/esm2022/src/ClientManager.mjs +421 -0
- package/esm2022/src/CommandsProcessorBase.mjs +56 -0
- package/{esm2020 → esm2022}/src/CommandsProcessorManager.mjs +25 -25
- package/esm2022/src/CommandsTable.mjs +162 -0
- package/esm2022/src/ConstInterface.mjs +517 -0
- package/{esm2020 → esm2022}/src/CurrentClientVersion.mjs +2 -2
- package/esm2022/src/FlowMonitorInterface.mjs +16 -0
- package/esm2022/src/GUIManager.mjs +62 -0
- package/esm2022/src/GlobalCommandsManager.mjs +34 -0
- package/esm2022/src/GuiEventsProcessor.mjs +156 -0
- package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
- package/esm2022/src/ServerConfig.mjs +122 -0
- package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
- package/esm2022/src/bridge/MagicBridge.mjs +41 -0
- package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
- package/esm2022/src/commands/ClientToServer/BrowserEscEventCommand.mjs +26 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +59 -59
- package/esm2022/src/commands/ClientToServer/ColumnSortEventCommand.mjs +29 -0
- package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +261 -0
- package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
- package/esm2022/src/commands/ClientToServer/ComputeEventCommand.mjs +26 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +24 -21
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +23 -20
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ControlItemsRefreshCommand.mjs +8 -8
- package/esm2022/src/commands/ClientToServer/DataViewOutputCommand.mjs +13 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/DataviewCommand.mjs +44 -44
- package/esm2022/src/commands/ClientToServer/EvaluateCommand.mjs +40 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/EventCommand.mjs +43 -40
- package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +70 -0
- package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +25 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
- package/esm2022/src/commands/ClientToServer/IndexChangeEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +26 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +26 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
- package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +30 -0
- package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +30 -0
- package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +43 -0
- package/esm2022/src/commands/ClientToServer/SelectProgramCommand.mjs +19 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
- package/esm2022/src/commands/ClientToServer/SubformOpenEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +34 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +18 -15
- package/esm2022/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +18 -0
- package/esm2022/src/commands/DataViewCommandBase.mjs +8 -0
- package/{esm2020 → esm2022}/src/commands/IClientCommand.mjs +1 -1
- package/esm2022/src/commands/IClientTargetedCommand.mjs +13 -0
- package/{esm2020 → esm2022}/src/commands/IClientToServerCommandInfo.mjs +2 -2
- package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
- package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
- package/{esm2020 → esm2022}/src/commands/ServerToClient/AddRangeCommand.mjs +62 -62
- package/{esm2020 → esm2022}/src/commands/ServerToClient/AddSortCommand.mjs +33 -33
- package/esm2022/src/commands/ServerToClient/ClientRefreshCommand.mjs +25 -0
- package/esm2022/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +24 -0
- package/esm2022/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +45 -0
- package/esm2022/src/commands/ServerToClient/OpenURLCommand.mjs +221 -0
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetLocateCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetRangeCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetSortCommand.mjs +14 -14
- package/esm2022/src/commands/ServerToClient/ResultCommand.mjs +37 -0
- package/esm2022/src/commands/ServerToClient/VerifyCommand.mjs +83 -0
- package/{esm2020 → esm2022}/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -132
- package/{esm2020 → esm2022}/src/communications/IConnectionStateManager.mjs +1 -1
- package/esm2022/src/communications/InteractiveCommunicationsFailureHandler.mjs +15 -0
- package/{esm2020 → esm2022}/src/data/DataSourceIdKey.mjs +2 -2
- package/esm2022/src/data/DataView.mjs +1613 -0
- package/{esm2020 → esm2022}/src/data/DataViewBase.mjs +3 -3
- package/esm2022/src/data/DataviewManager.mjs +28 -0
- package/esm2022/src/data/DataviewManagerBase.mjs +15 -0
- package/esm2022/src/data/DvCache.mjs +67 -0
- package/esm2022/src/data/Field.mjs +646 -0
- package/esm2022/src/data/FieldBase.mjs +15 -0
- package/esm2022/src/data/FieldsTable.mjs +103 -0
- package/{esm2020 → esm2022}/src/data/IRecordsTable.mjs +1 -1
- package/{esm2020 → esm2022}/src/data/Key.mjs +88 -88
- package/esm2022/src/data/Record.mjs +880 -0
- package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
- package/esm2022/src/data/RecordsTable.mjs +267 -0
- package/{esm2020 → esm2022}/src/data/TaskTransactionManager.mjs +107 -103
- package/{esm2020 → esm2022}/src/data/XMLBasedDcValuesBuilder.mjs +74 -74
- package/{esm2020 → esm2022}/src/enums.mjs +23 -23
- package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
- package/esm2022/src/env/Environment.mjs +487 -0
- package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
- package/esm2022/src/env/LanguageData.mjs +227 -0
- package/{esm2020 → esm2022}/src/env/MirrorString.mjs +65 -65
- package/esm2022/src/event/ActionManager.mjs +91 -0
- package/esm2022/src/event/Event.mjs +1333 -0
- package/esm2022/src/event/EventHandler.mjs +766 -0
- package/esm2022/src/event/EventHandlerPosition.mjs +204 -0
- package/esm2022/src/event/EventsManager.mjs +2988 -0
- package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
- package/esm2022/src/event/RunTimeEvent.mjs +399 -0
- package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
- package/esm2022/src/event/UserEventsTable.mjs +47 -0
- package/esm2022/src/exp/ExpTable.mjs +57 -0
- package/esm2022/src/exp/Expression.mjs +200 -0
- package/esm2022/src/exp/ExpressionDict.mjs +727 -0
- package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
- package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
- package/{esm2020 → esm2022}/src/exp/GlobalParamsTable.mjs +85 -85
- package/esm2022/src/exp/YesNoExp.mjs +36 -0
- package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
- package/esm2022/src/gui/FormsTable.mjs +66 -0
- package/esm2022/src/gui/MgControl.mjs +363 -0
- package/esm2022/src/gui/MgForm.mjs +1224 -0
- package/esm2022/src/http/HttpManager.mjs +97 -0
- package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
- package/{esm2020 → esm2022}/src/http/client/HttpClientBase.mjs +132 -132
- package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
- package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
- package/esm2022/src/http/client/HttpUtility.mjs +84 -0
- package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
- package/{esm2020 → esm2022}/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -18
- package/{esm2020 → esm2022}/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -18
- package/{esm2020 → esm2022}/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -18
- package/esm2022/src/remote/RemoteCommandsProcessor.mjs +883 -0
- package/{esm2020 → esm2022}/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -25
- package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandBase.mjs +24 -24
- package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandFactory.mjs +60 -60
- package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
- package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
- package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
- package/{esm2020 → esm2022}/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +16 -16
- package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
- package/{esm2020 → esm2022}/src/remote/ResetUserSortRemoteDataviewCommand.mjs +15 -15
- package/esm2022/src/remote/ServerError.mjs +40 -0
- package/{esm2020 → esm2022}/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +19 -19
- package/esm2022/src/rt/Argument.mjs +265 -0
- package/esm2022/src/rt/ArgumentsList.mjs +103 -0
- package/esm2022/src/rt/Boundary.mjs +152 -0
- package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
- package/esm2022/src/rt/DataviewHeaderBase.mjs +98 -0
- package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
- package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
- package/{esm2020 → esm2022}/src/rt/DataviewHeadersSaxHandler.mjs +38 -38
- package/{esm2020 → esm2022}/src/rt/ExecutionStack.mjs +94 -94
- package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
- package/{esm2020 → esm2022}/src/rt/HandlersTable.mjs +96 -96
- package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
- package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
- package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
- package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
- package/esm2022/src/rt/Operation.mjs +735 -0
- package/esm2022/src/rt/OperationTable.mjs +67 -0
- package/esm2022/src/rt/Recompute.mjs +355 -0
- package/{esm2020 → esm2022}/src/rt/RecomputeTable.mjs +62 -62
- package/{esm2020 → esm2022}/src/rt/RemoteDataviewHeader.mjs +108 -108
- package/esm2022/src/rt/ResultValue.mjs +10 -0
- package/esm2022/src/rt/TableCache.mjs +177 -0
- package/esm2022/src/rt/TableCacheManager.mjs +67 -0
- package/esm2022/src/rt/Transaction.mjs +53 -0
- package/esm2022/src/security/UserDetails.mjs +71 -0
- package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
- package/esm2022/src/tasks/MGData.mjs +552 -0
- package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
- package/esm2022/src/tasks/RCTimer.mjs +63 -0
- package/{esm2020 → esm2022}/src/tasks/RemoteTaskService.mjs +44 -44
- package/esm2022/src/tasks/Task.mjs +2499 -0
- package/esm2022/src/tasks/TaskBase.mjs +83 -0
- package/{esm2020 → esm2022}/src/tasks/TaskServiceBase.mjs +24 -24
- package/esm2022/src/tasks/TasksTable.mjs +80 -0
- package/esm2022/src/tasks/sort/Sort.mjs +5 -0
- package/{esm2020 → esm2022}/src/tasks/sort/SortCollection.mjs +67 -67
- package/{esm2020 → esm2022}/src/util/ConstUtils.mjs +13 -13
- package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
- package/{esm2020 → esm2022}/src/util/HeapSort.mjs +69 -69
- package/{esm2020 → esm2022}/src/util/IMirrorXML.mjs +1 -1
- package/{esm2020 → esm2022}/src/util/IServerConfig.mjs +1 -1
- package/{esm2020 → esm2022}/src/util/MgBlockingQueue.mjs +1 -1
- package/esm2022/src/util/MgPriorityBlockingQueue.mjs +74 -0
- package/esm2022/src/util/MgPriorityQueue.mjs +66 -0
- package/{esm2020 → esm2022}/src/util/ParamParseResult.mjs +7 -7
- package/esm2022/src/util/PrmMap.mjs +152 -0
- package/esm2022/src/util/ReturnResult.mjs +46 -0
- package/esm2022/src/util/ReturnResultBase.mjs +18 -0
- package/esm2022/src/util/Scrambler.mjs +89 -0
- package/esm2022/src/util/UniqueIDUtils.mjs +13 -0
- package/{esm2020 → esm2022}/src/util/cookie.service.mjs +92 -92
- package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29888 -29690
- package/fesm2022/magic-xpa-engine.mjs.map +1 -0
- package/index.d.ts +187 -187
- package/package.json +8 -14
- package/src/AccessHelper.d.ts +20 -20
- package/src/ClientManager.d.ts +35 -32
- package/src/CommandsProcessorBase.d.ts +23 -23
- package/src/CommandsProcessorManager.d.ts +6 -6
- package/src/CommandsTable.d.ts +22 -22
- package/src/ConstInterface.d.ts +516 -515
- package/src/CurrentClientVersion.d.ts +1 -1
- package/src/FlowMonitorInterface.d.ts +15 -15
- package/src/GUIManager.d.ts +17 -17
- package/src/GlobalCommandsManager.d.ts +17 -17
- package/src/GuiEventsProcessor.d.ts +24 -24
- package/src/ICommandsTable.d.ts +9 -9
- package/src/ServerConfig.d.ts +35 -34
- package/src/bridge/IGuiEvent.d.ts +19 -19
- package/src/bridge/MagicBridge.d.ts +16 -16
- package/src/commands/ClientOriginatedCommandTaskTag.d.ts +8 -8
- package/src/commands/ClientToServer/AddUserLocateDataViewCommand.d.ts +4 -4
- package/src/commands/ClientToServer/AddUserRangeDataviewCommand.d.ts +6 -6
- package/src/commands/ClientToServer/AddUserSortDataViewCommand.d.ts +6 -6
- package/src/commands/ClientToServer/BrowserEscEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/ClientOriginatedCommand.d.ts +8 -8
- package/src/commands/ClientToServer/ClientOriginatedCommandSerializer.d.ts +6 -6
- package/src/commands/ClientToServer/ColumnSortEventCommand.d.ts +11 -10
- package/src/commands/ClientToServer/CommandFactory.d.ts +64 -64
- package/src/commands/ClientToServer/CommandSerializationHelper.d.ts +20 -20
- package/src/commands/ClientToServer/ComputeEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +8 -7
- package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +8 -7
- package/src/commands/ClientToServer/ControlItemsRefreshCommand.d.ts +6 -6
- package/src/commands/ClientToServer/DataViewOutputCommand.d.ts +9 -9
- package/src/commands/ClientToServer/DataviewCommand.d.ts +32 -32
- package/src/commands/ClientToServer/EvaluateCommand.d.ts +16 -15
- package/src/commands/ClientToServer/EventCommand.d.ts +16 -15
- package/src/commands/ClientToServer/ExecOperCommand.d.ts +24 -23
- package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/GlobalParamsQueryCommand.d.ts +5 -5
- package/src/commands/ClientToServer/ICommandTaskTag.d.ts +3 -3
- package/src/commands/ClientToServer/IndexChangeEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +11 -10
- package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
- package/src/commands/ClientToServer/RecomputeCommand.d.ts +12 -11
- package/src/commands/ClientToServer/RefreshEventCommand.d.ts +13 -12
- package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +11 -10
- package/src/commands/ClientToServer/RollbackEventCommand.d.ts +15 -14
- package/src/commands/ClientToServer/SelectProgramCommand.d.ts +7 -6
- package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
- package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +10 -9
- package/src/commands/ClientToServer/TransactionCommand.d.ts +14 -12
- package/src/commands/ClientToServer/UnloadCommand.d.ts +8 -7
- package/src/commands/ClientToServer/WriteMessageToServerLogCommand.d.ts +6 -6
- package/src/commands/DataViewCommandBase.d.ts +6 -6
- package/src/commands/IClientCommand.d.ts +2 -2
- package/src/commands/IClientTargetedCommand.d.ts +12 -12
- package/src/commands/IClientToServerCommandInfo.d.ts +4 -3
- package/src/commands/ServerToClient/AbortCommand.d.ts +11 -11
- package/src/commands/ServerToClient/AddLocateCommand.d.ts +6 -6
- package/src/commands/ServerToClient/AddRangeCommand.d.ts +10 -10
- package/src/commands/ServerToClient/AddSortCommand.d.ts +9 -9
- package/src/commands/ServerToClient/ClientRefreshCommand.d.ts +7 -7
- package/src/commands/ServerToClient/ClientTargetedCommandBase.d.ts +12 -12
- package/src/commands/ServerToClient/EnhancedVerifyCommand.d.ts +13 -13
- package/src/commands/ServerToClient/OpenURLCommand.d.ts +21 -21
- package/src/commands/ServerToClient/ResetLocateCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResetRangeCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResetSortCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResultCommand.d.ts +10 -10
- package/src/commands/ServerToClient/VerifyCommand.d.ts +17 -17
- package/src/commands/ServerToClient/XMLBasedCommandBuilder.d.ts +11 -11
- package/src/communications/IConnectionStateManager.d.ts +4 -4
- package/src/communications/InteractiveCommunicationsFailureHandler.d.ts +6 -6
- package/src/data/DataSourceIdKey.d.ts +2 -2
- package/src/data/DataView.d.ts +162 -162
- package/src/data/DataViewBase.d.ts +12 -12
- package/src/data/DataviewManager.d.ts +14 -14
- package/src/data/DataviewManagerBase.d.ts +11 -11
- package/src/data/DvCache.d.ts +15 -15
- package/src/data/Field.d.ts +103 -103
- package/src/data/FieldBase.d.ts +23 -23
- package/src/data/FieldsTable.d.ts +27 -27
- package/src/data/IRecordsTable.d.ts +7 -7
- package/src/data/Key.d.ts +15 -15
- package/src/data/Record.d.ts +157 -156
- package/src/data/RecordOutOfDataViewException.d.ts +10 -10
- package/src/data/RecordsTable.d.ts +38 -38
- package/src/data/TaskTransactionManager.d.ts +17 -17
- package/src/data/XMLBasedDcValuesBuilder.d.ts +11 -11
- package/src/enums.d.ts +21 -21
- package/src/env/EnvVariablesTable.d.ts +17 -17
- package/src/env/Environment.d.ts +118 -118
- package/src/env/ILanguageData.d.ts +3 -3
- package/src/env/LanguageData.d.ts +20 -20
- package/src/env/MirrorString.d.ts +15 -15
- package/src/event/ActionManager.d.ts +14 -14
- package/src/event/Event.d.ts +79 -79
- package/src/event/EventHandler.d.ts +66 -66
- package/src/event/EventHandlerPosition.d.ts +25 -25
- package/src/event/EventsManager.d.ts +205 -204
- package/src/event/IEventsManager.d.ts +77 -77
- package/src/event/RunTimeEvent.d.ts +126 -123
- package/src/event/RunTimeEventBase.d.ts +5 -5
- package/src/event/UserEventsTable.d.ts +11 -11
- package/src/exp/ExpTable.d.ts +11 -11
- package/src/exp/Expression.d.ts +37 -37
- package/src/exp/ExpressionDict.d.ts +12 -12
- package/src/exp/ExpressionEvaluator.d.ts +198 -198
- package/src/exp/ExpressionLocalJpn.d.ts +18 -18
- package/src/exp/GlobalParamsTable.d.ts +19 -19
- package/src/exp/YesNoExp.d.ts +9 -9
- package/src/gui/CreatedFormVector.d.ts +10 -10
- package/src/gui/FormsTable.d.ts +15 -15
- package/src/gui/MgControl.d.ts +60 -60
- package/src/gui/MgForm.d.ts +96 -93
- package/src/http/HttpManager.d.ts +25 -25
- package/src/http/client/HttpClientAsync.d.ts +16 -16
- package/src/http/client/HttpClientBase.d.ts +30 -30
- package/src/http/client/HttpClientEvents.d.ts +18 -18
- package/src/http/client/HttpClientSync.d.ts +17 -17
- package/src/http/client/HttpUtility.d.ts +10 -10
- package/src/http/client/ICommunicationsFailureHandler.d.ts +5 -5
- package/src/remote/AddUserLocateRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/AddUserRangeRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/AddUserSortRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/RemoteCommandsProcessor.d.ts +51 -51
- package/src/remote/RemoteControlItemsRefreshCommand.d.ts +8 -8
- package/src/remote/RemoteDataViewCommandBase.d.ts +10 -10
- package/src/remote/RemoteDataViewCommandFactory.d.ts +6 -6
- package/src/remote/RemoteDataViewCommandUpdateNonModifiable.d.ts +8 -8
- package/src/remote/RemoteDataviewManager.d.ts +9 -9
- package/src/remote/RemoteInitDataViewCommand.d.ts +7 -7
- package/src/remote/ResetUserLocateRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ResetUserRangeRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ResetUserSortRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ServerError.d.ts +16 -16
- package/src/remote/SetTransactionStateRemoteDataViewCommand.d.ts +8 -8
- package/src/rt/Argument.d.ts +36 -36
- package/src/rt/ArgumentsList.d.ts +24 -24
- package/src/rt/Boundary.d.ts +27 -27
- package/src/rt/CompMainPrgTable.d.ts +10 -10
- package/src/rt/DataviewHeaderBase.d.ts +34 -34
- package/src/rt/DataviewHeaderFactory.d.ts +5 -5
- package/src/rt/DataviewHeaders.d.ts +12 -12
- package/src/rt/DataviewHeadersSaxHandler.d.ts +10 -10
- package/src/rt/ExecutionStack.d.ts +22 -22
- package/src/rt/ExecutionStackEntry.d.ts +7 -7
- package/src/rt/HandlersTable.d.ts +19 -19
- package/src/rt/IDataSourceViewDefinition.d.ts +6 -6
- package/src/rt/IDataviewHeader.d.ts +10 -10
- package/src/rt/IResultValue.d.ts +4 -4
- package/src/rt/LastFocusedManager.d.ts +23 -23
- package/src/rt/Operation.d.ts +97 -97
- package/src/rt/OperationTable.d.ts +15 -15
- package/src/rt/Recompute.d.ts +41 -41
- package/src/rt/RecomputeTable.d.ts +9 -9
- package/src/rt/RemoteDataviewHeader.d.ts +14 -14
- package/src/rt/ResultValue.d.ts +7 -7
- package/src/rt/TableCache.d.ts +29 -29
- package/src/rt/TableCacheManager.d.ts +10 -10
- package/src/rt/Transaction.d.ts +23 -23
- package/src/security/UserDetails.d.ts +16 -16
- package/src/tasks/IMGDataCollection.d.ts +26 -26
- package/src/tasks/MGData.d.ts +63 -63
- package/src/tasks/MGDataCollection.d.ts +42 -42
- package/src/tasks/RCTimer.d.ts +13 -13
- package/src/tasks/RemoteTaskService.d.ts +16 -16
- package/src/tasks/Task.d.ts +312 -312
- package/src/tasks/TaskBase.d.ts +123 -123
- package/src/tasks/TaskServiceBase.d.ts +16 -16
- package/src/tasks/TasksTable.d.ts +21 -21
- package/src/tasks/sort/Sort.d.ts +4 -4
- package/src/tasks/sort/SortCollection.d.ts +11 -11
- package/src/util/ConstUtils.d.ts +3 -3
- package/src/util/FlowMonitorQueue.d.ts +70 -70
- package/src/util/HeapSort.d.ts +6 -6
- package/src/util/IMirrorXML.d.ts +6 -6
- package/src/util/IServerConfig.d.ts +11 -11
- package/src/util/MgBlockingQueue.d.ts +5 -5
- package/src/util/MgPriorityBlockingQueue.d.ts +17 -17
- package/src/util/MgPriorityQueue.d.ts +13 -13
- package/src/util/ParamParseResult.d.ts +6 -6
- package/src/util/PrmMap.d.ts +28 -28
- package/src/util/ReturnResult.d.ts +18 -18
- package/src/util/ReturnResultBase.d.ts +11 -11
- package/src/util/Scrambler.d.ts +10 -10
- package/src/util/UniqueIDUtils.d.ts +4 -4
- package/src/util/cookie.service.d.ts +8 -8
- package/esm2020/src/AccessHelper.mjs +0 -9
- package/esm2020/src/ClientManager.mjs +0 -399
- package/esm2020/src/CommandsProcessorBase.mjs +0 -58
- package/esm2020/src/CommandsTable.mjs +0 -162
- package/esm2020/src/ConstInterface.mjs +0 -516
- package/esm2020/src/FlowMonitorInterface.mjs +0 -16
- package/esm2020/src/GUIManager.mjs +0 -62
- package/esm2020/src/GlobalCommandsManager.mjs +0 -34
- package/esm2020/src/GuiEventsProcessor.mjs +0 -154
- package/esm2020/src/ServerConfig.mjs +0 -117
- package/esm2020/src/bridge/MagicBridge.mjs +0 -41
- package/esm2020/src/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
- package/esm2020/src/commands/ClientToServer/BrowserEscEventCommand.mjs +0 -23
- package/esm2020/src/commands/ClientToServer/ColumnSortEventCommand.mjs +0 -26
- package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
- package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
- package/esm2020/src/commands/ClientToServer/ComputeEventCommand.mjs +0 -23
- package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
- package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
- package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
- package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
- package/esm2020/src/commands/ClientToServer/IndexChangeEventCommand.mjs +0 -21
- package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
- package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
- package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
- package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
- package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
- package/esm2020/src/commands/ClientToServer/SelectProgramCommand.mjs +0 -15
- package/esm2020/src/commands/ClientToServer/SubformOpenEventCommand.mjs +0 -21
- package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
- package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
- package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
- package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
- package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
- package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
- package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
- package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
- package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
- package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
- package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
- package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
- package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
- package/esm2020/src/data/DataView.mjs +0 -1610
- package/esm2020/src/data/DataviewManager.mjs +0 -28
- package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
- package/esm2020/src/data/DvCache.mjs +0 -67
- package/esm2020/src/data/Field.mjs +0 -646
- package/esm2020/src/data/FieldBase.mjs +0 -18
- package/esm2020/src/data/FieldsTable.mjs +0 -103
- package/esm2020/src/data/Record.mjs +0 -846
- package/esm2020/src/data/RecordsTable.mjs +0 -267
- package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
- package/esm2020/src/env/Environment.mjs +0 -489
- package/esm2020/src/env/LanguageData.mjs +0 -226
- package/esm2020/src/event/ActionManager.mjs +0 -91
- package/esm2020/src/event/Event.mjs +0 -1333
- package/esm2020/src/event/EventHandler.mjs +0 -766
- package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
- package/esm2020/src/event/EventsManager.mjs +0 -2975
- package/esm2020/src/event/RunTimeEvent.mjs +0 -392
- package/esm2020/src/event/UserEventsTable.mjs +0 -47
- package/esm2020/src/exp/ExpTable.mjs +0 -59
- package/esm2020/src/exp/Expression.mjs +0 -200
- package/esm2020/src/exp/ExpressionDict.mjs +0 -727
- package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4208
- package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
- package/esm2020/src/exp/YesNoExp.mjs +0 -36
- package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
- package/esm2020/src/gui/FormsTable.mjs +0 -66
- package/esm2020/src/gui/MgControl.mjs +0 -353
- package/esm2020/src/gui/MgForm.mjs +0 -1181
- package/esm2020/src/http/HttpManager.mjs +0 -97
- package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
- package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
- package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
- package/esm2020/src/http/client/HttpUtility.mjs +0 -84
- package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
- package/esm2020/src/remote/ServerError.mjs +0 -40
- package/esm2020/src/rt/Argument.mjs +0 -265
- package/esm2020/src/rt/ArgumentsList.mjs +0 -103
- package/esm2020/src/rt/Boundary.mjs +0 -152
- package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
- package/esm2020/src/rt/DataviewHeaderBase.mjs +0 -96
- package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
- package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
- package/esm2020/src/rt/Operation.mjs +0 -735
- package/esm2020/src/rt/OperationTable.mjs +0 -67
- package/esm2020/src/rt/Recompute.mjs +0 -355
- package/esm2020/src/rt/ResultValue.mjs +0 -12
- package/esm2020/src/rt/TableCache.mjs +0 -177
- package/esm2020/src/rt/TableCacheManager.mjs +0 -67
- package/esm2020/src/rt/Transaction.mjs +0 -53
- package/esm2020/src/security/UserDetails.mjs +0 -71
- package/esm2020/src/tasks/MGData.mjs +0 -552
- package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
- package/esm2020/src/tasks/RCTimer.mjs +0 -63
- package/esm2020/src/tasks/Task.mjs +0 -2496
- package/esm2020/src/tasks/TaskBase.mjs +0 -87
- package/esm2020/src/tasks/TasksTable.mjs +0 -80
- package/esm2020/src/tasks/sort/Sort.mjs +0 -7
- package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
- package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
- package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
- package/esm2020/src/util/PrmMap.mjs +0 -151
- package/esm2020/src/util/ReturnResult.mjs +0 -46
- package/esm2020/src/util/ReturnResultBase.mjs +0 -18
- package/esm2020/src/util/Scrambler.mjs +0 -89
- package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
- package/fesm2015/magic-xpa-engine.mjs +0 -30837
- package/fesm2015/magic-xpa-engine.mjs.map +0 -1
- package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -0,0 +1,2988 @@
|
|
1
|
+
import { Constants, ForceExit, InternalInterface, Logger, Logger_LogLevels, MgControlType, Misc, MsgInterface, Priority, RaiseAt, StorageAttribute, StrUtil, SubformType } from '@magic-xpa/utils';
|
2
|
+
import { ApplicationException, Int32, List, NString, RefParam, Stack, StringBuilder, Thread, isNullOrUndefined } from '@magic-xpa/mscorelib';
|
3
|
+
import { Commands, CommandType, DataModificationTypes, ExpVal, FocusManager, GuiConstants, GuiEnvironment, KeyboardItem, Manager, Modifiers, PropInterface, RuntimeContextBase, Styles, TaskDefinitionId } from '@magic-xpa/gui';
|
4
|
+
import { EventSubType } from '../enums';
|
5
|
+
import { RollbackEventCommand_RollbackType } from '../commands/ClientToServer/RollbackEventCommand';
|
6
|
+
import { MgControl } from '../gui/MgControl';
|
7
|
+
import { MgPriorityBlockingQueue } from '../util/MgPriorityBlockingQueue';
|
8
|
+
import { RunTimeEvent } from './RunTimeEvent';
|
9
|
+
import { FlowMonitorQueue } from '../util/FlowMonitorQueue';
|
10
|
+
import { GUIManager } from '../GUIManager';
|
11
|
+
import { Task } from '../tasks/Task';
|
12
|
+
import { Task_SubformExecModeEnum } from '../tasks/TaskBase';
|
13
|
+
import { ArgumentsList } from '../rt/ArgumentsList';
|
14
|
+
import { MGData } from '../tasks/MGData';
|
15
|
+
import { MGDataCollection } from '../tasks/MGDataCollection';
|
16
|
+
import { RecordOutOfDataViewException } from '../data/RecordOutOfDataViewException';
|
17
|
+
import { CommandsProcessorBase_SendingInstruction } from '../CommandsProcessorBase';
|
18
|
+
import { CommandFactory } from '../commands/ClientToServer/CommandFactory';
|
19
|
+
import { CommandsProcessorManager } from '../CommandsProcessorManager';
|
20
|
+
import { ClientRefreshCommand } from '../commands/ServerToClient/ClientRefreshCommand';
|
21
|
+
import { RemoteCommandsProcessor } from '../remote/RemoteCommandsProcessor';
|
22
|
+
import { ExecutionStack } from '../rt/ExecutionStack';
|
23
|
+
import { EventHandlerPosition } from './EventHandlerPosition';
|
24
|
+
import { ConstInterface } from '../ConstInterface';
|
25
|
+
import { FlowMonitorInterface } from '../FlowMonitorInterface';
|
26
|
+
import { DataViewCommandType } from '../commands/ClientToServer/DataviewCommand';
|
27
|
+
import { ServerError } from '../remote/ServerError';
|
28
|
+
import { Environment } from '../env/Environment';
|
29
|
+
import { LastFocusedManager } from '../rt/LastFocusedManager';
|
30
|
+
import { EventsAllowedType } from './IEventsManager';
|
31
|
+
import { LanguageData } from '../env/LanguageData';
|
32
|
+
import { Subject } from 'rxjs';
|
33
|
+
import { ClientManager } from '../ClientManager';
|
34
|
+
import { ClearEventsOnStopExecution } from '../AccessHelper';
|
35
|
+
var EventScope;
|
36
|
+
(function (EventScope) {
|
37
|
+
EventScope["NONE"] = " ";
|
38
|
+
EventScope["TRANS"] = "T";
|
39
|
+
})(EventScope || (EventScope = {}));
|
40
|
+
export class EventsManager {
|
41
|
+
static REAL_ONLY = true;
|
42
|
+
static MAX_OPER = 9999;
|
43
|
+
static userGrantedForContextActivity = true;
|
44
|
+
_eventsQueue = null;
|
45
|
+
_execStack = null;
|
46
|
+
_rtEvents = null;
|
47
|
+
_serverExecStack = null;
|
48
|
+
_allowEvents = EventsAllowedType.ALL;
|
49
|
+
_compMainPrgTab = null;
|
50
|
+
_currCtrl = null;
|
51
|
+
_currField = null;
|
52
|
+
_currKbdItem = null;
|
53
|
+
_endOfWork = false;
|
54
|
+
_eventScope = EventScope.NONE;
|
55
|
+
_forceExit = ForceExit.None;
|
56
|
+
_forceExitTask = null;
|
57
|
+
_ignoreUnknownAbort = false;
|
58
|
+
_initialized = false;
|
59
|
+
_isHandlingForceExit = false;
|
60
|
+
_isNonReversibleExit = false;
|
61
|
+
_isInRecordFlushEvent = false;
|
62
|
+
static clientInactivityTimerON = false;
|
63
|
+
static clientContextInactivityTimerAborted = false;
|
64
|
+
lastSavedRouteEvent = null;
|
65
|
+
_stopExecution = false;
|
66
|
+
_processingTopMostEndTask = false;
|
67
|
+
_stopExecutionCtrl = null;
|
68
|
+
guiPendingEvent = null;
|
69
|
+
KBI_DOWN = null;
|
70
|
+
KBI_UP = null;
|
71
|
+
confirmationDialogMsg = 'The server context serving this application is about to time out. Do you want to continue your work?';
|
72
|
+
confirmationDialogTitle = 'Session is about to be terminated!';
|
73
|
+
static Instance = new EventsManager();
|
74
|
+
_lastFailedFocusedControl = null;
|
75
|
+
isSpinnerShown = false;
|
76
|
+
isInViewRefresh = false;
|
77
|
+
SpinnerStopped = new Subject();
|
78
|
+
static clientBusyTimeStart = 0;
|
79
|
+
constructor() {
|
80
|
+
this._rtEvents = new Stack();
|
81
|
+
this._eventsQueue = new MgPriorityBlockingQueue();
|
82
|
+
this._execStack = new Stack();
|
83
|
+
this._execStack.push(new ExecutionStack());
|
84
|
+
this._serverExecStack = new Stack();
|
85
|
+
this._serverExecStack.push(null);
|
86
|
+
this.KBI_DOWN = new KeyboardItem(GuiConstants.KEY_DOWN, Modifiers.MODIFIER_NONE);
|
87
|
+
this.KBI_UP = new KeyboardItem(GuiConstants.KEY_UP, Modifiers.MODIFIER_NONE);
|
88
|
+
}
|
89
|
+
getPendingGuiEvent() {
|
90
|
+
return this.guiPendingEvent;
|
91
|
+
}
|
92
|
+
setPendingGuiEvent(guiEvent) {
|
93
|
+
this.guiPendingEvent = guiEvent;
|
94
|
+
}
|
95
|
+
addToTail(rtEvt) {
|
96
|
+
if (!rtEvt.isIdleTimer()) {
|
97
|
+
if (EventsManager.clientInactivityTimerON) {
|
98
|
+
EventsManager.clientContextInactivityTimerAborted = true;
|
99
|
+
}
|
100
|
+
}
|
101
|
+
else {
|
102
|
+
if (this.getLastSavedRouteEvent() != null) {
|
103
|
+
this.addToTail(this.getLastSavedRouteEvent());
|
104
|
+
this.setLastSavedRouteEvent(null);
|
105
|
+
}
|
106
|
+
}
|
107
|
+
this._eventsQueue.put(rtEvt);
|
108
|
+
}
|
109
|
+
AddKeyboardEvent(mgForm, mgControl, modifier, keyCode, start, end, text, isActChar, suggestedValue, code) {
|
110
|
+
let rtEvt = (mgControl !== null) ? new RunTimeEvent(mgControl, true, false) : new RunTimeEvent(mgForm.getTask(), true);
|
111
|
+
rtEvt.setInternal(code);
|
112
|
+
let newKbItem = new KeyboardItem(keyCode, modifier);
|
113
|
+
if (isActChar && (mgControl !== null && (mgControl.isTextControl())))
|
114
|
+
newKbItem.setAction(InternalInterface.MG_ACT_CHAR);
|
115
|
+
rtEvt.setKeyboardItem(newKbItem);
|
116
|
+
if (code === InternalInterface.MG_ACT_CTRL_KEYDOWN) {
|
117
|
+
rtEvt.setEditParms(start, end, text);
|
118
|
+
}
|
119
|
+
else
|
120
|
+
rtEvt.setValue(suggestedValue);
|
121
|
+
this.addToTail(rtEvt);
|
122
|
+
return;
|
123
|
+
}
|
124
|
+
async checkParkability() {
|
125
|
+
let current = LastFocusedManager.getLastFocusedControl();
|
126
|
+
if (current !== null && (current.getForm().getTask()).getLevel() === Constants.TASK_LEVEL_CONTROL && !await current.IsParkable())
|
127
|
+
await this.HandleNonParkableControls(current.getForm().getTask());
|
128
|
+
}
|
129
|
+
async HandleParkabilityOnRowChange(itask) {
|
130
|
+
await this.HandleNonParkableControls(itask);
|
131
|
+
}
|
132
|
+
async HandleNonParkableControls(itask) {
|
133
|
+
let task = itask;
|
134
|
+
if (task.getMode() === Constants.TASK_MODE_CREATE && task.IsInteractive) {
|
135
|
+
await task.enableModes();
|
136
|
+
let oldMode = task.getOriginalTaskMode();
|
137
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
138
|
+
if (!this.GetStopExecutionFlag()) {
|
139
|
+
if (oldMode !== Constants.TASK_MODE_CREATE) {
|
140
|
+
task.setMode(oldMode);
|
141
|
+
await task.DataView.currRecCompute(true);
|
142
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
143
|
+
await task.getForm().RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
144
|
+
task.setLastParkedCtrl(null);
|
145
|
+
await FocusManager.SetFocus(task, null, -1, true);
|
146
|
+
return;
|
147
|
+
}
|
148
|
+
}
|
149
|
+
}
|
150
|
+
if (task.getLevel() === Constants.TASK_LEVEL_CONTROL)
|
151
|
+
await this.handleInternalEventWithMgControlBase(task.getLastParkedCtrl(), InternalInterface.MG_ACT_CTRL_SUFFIX);
|
152
|
+
task.setLastParkedCtrl(null);
|
153
|
+
MgControl.ReturnToCtrl = null;
|
154
|
+
await FocusManager.SetFocus(task, null, -1, true);
|
155
|
+
}
|
156
|
+
async handleEvent(rtEvt, returnedFromServer) {
|
157
|
+
let handler = null;
|
158
|
+
let pos = new EventHandlerPosition();
|
159
|
+
let task = rtEvt.getTask();
|
160
|
+
let ctrl = task.getLastParkedCtrl();
|
161
|
+
let forceExitDone = false;
|
162
|
+
let endTaskError = false;
|
163
|
+
let oldRtEvt = null;
|
164
|
+
let oldForceExit = this.getForceExit();
|
165
|
+
let oldForceExitTask = this.getForceExitTask();
|
166
|
+
let oldIsHandlingForceExit = this._isHandlingForceExit;
|
167
|
+
let restoreIsForceExit = false;
|
168
|
+
let restoreCurrCtrl;
|
169
|
+
let restoreCurrField = null;
|
170
|
+
if ((rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL)) {
|
171
|
+
if (rtEvt.InternalEvent < InternalInterface.MG_ACT_TOT_CNT && (!task.ActionManager.isEnabled(rtEvt.InternalEvent) || (!rtEvt.isImmediate() && this.NoEventsAllowed())))
|
172
|
+
return;
|
173
|
+
}
|
174
|
+
else if (!rtEvt.isImmediate() && this.NoEventsAllowed())
|
175
|
+
return;
|
176
|
+
restoreCurrCtrl = this._currCtrl;
|
177
|
+
this._currCtrl = ctrl;
|
178
|
+
let propagate = rtEvt.getType() !== ConstInterface.EVENT_TYPE_INTERNAL || rtEvt.getInternalCode() < 1000;
|
179
|
+
try {
|
180
|
+
this.pushRtEvent(rtEvt);
|
181
|
+
await this.CheckAndShowSpinner(true);
|
182
|
+
let bRcBefore = await this.commonHandlerBefore(rtEvt);
|
183
|
+
restoreCurrField = this._currField;
|
184
|
+
this._currField = task.getCurrField();
|
185
|
+
if (bRcBefore) {
|
186
|
+
pos.init(rtEvt);
|
187
|
+
handler = pos.getNext();
|
188
|
+
if (handler !== null && handler.getEvent() !== null && handler.getEvent().UserEvt !== null)
|
189
|
+
this.setForceExit(handler.getEvent().UserEvt.ForceExit, task);
|
190
|
+
while (handler !== null) {
|
191
|
+
let handlerContextTask = null;
|
192
|
+
let rtEvtChanged;
|
193
|
+
try {
|
194
|
+
let enabledCndCheckedAndTrue = false;
|
195
|
+
handlerContextTask = handler.getTask().GetContextTask();
|
196
|
+
if (rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && rtEvt.getInternalCode() >= 1000 && rtEvt.getInternalCode() !== InternalInterface.MG_ACT_VARIABLE)
|
197
|
+
handler.getTask().SetContextTask(handler.getTask());
|
198
|
+
else
|
199
|
+
handler.getTask().SetContextTask(rtEvt.getTask());
|
200
|
+
if (handler.getEvent().getType() === ConstInterface.EVENT_TYPE_USER && await handler.isEnabled()) {
|
201
|
+
enabledCndCheckedAndTrue = true;
|
202
|
+
this._isHandlingForceExit = false;
|
203
|
+
restoreIsForceExit = true;
|
204
|
+
if (await this.handleForceExitBefore(handler.getEvent(), rtEvt)) {
|
205
|
+
forceExitDone = true;
|
206
|
+
}
|
207
|
+
}
|
208
|
+
if (rtEvt !== handler.getEvent()) {
|
209
|
+
oldRtEvt = rtEvt;
|
210
|
+
rtEvt = new RunTimeEvent(handler.getEvent(), rtEvt);
|
211
|
+
rtEvtChanged = true;
|
212
|
+
this.popRtEvent();
|
213
|
+
this.pushRtEvent(rtEvt);
|
214
|
+
}
|
215
|
+
else
|
216
|
+
rtEvtChanged = false;
|
217
|
+
if (rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && rtEvt.getInternalCode() === InternalInterface.MG_ACT_REC_SUFFIX)
|
218
|
+
rtEvt.getTask().setInRecordSuffix(true);
|
219
|
+
this.createEventArguments(rtEvt);
|
220
|
+
let handlerRetVals = await handler.execute(rtEvt, returnedFromServer, enabledCndCheckedAndTrue);
|
221
|
+
if (rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && rtEvt.getInternalCode() === InternalInterface.MG_ACT_REC_SUFFIX)
|
222
|
+
rtEvt.getTask().setInRecordSuffix(false);
|
223
|
+
propagate = handlerRetVals.Propagate;
|
224
|
+
if (!handlerRetVals.Enabled && rtEvtChanged) {
|
225
|
+
rtEvt = oldRtEvt;
|
226
|
+
oldRtEvt = null;
|
227
|
+
rtEvtChanged = false;
|
228
|
+
this.popRtEvent();
|
229
|
+
this.pushRtEvent(rtEvt);
|
230
|
+
}
|
231
|
+
if (rtEvt.getInternalCode() !== InternalInterface.MG_ACT_TASK_PREFIX && task.isStarted() && task.getExecEndTask()) {
|
232
|
+
endTaskError = await task.endTask(true, false, false);
|
233
|
+
if (endTaskError)
|
234
|
+
break;
|
235
|
+
}
|
236
|
+
if (this.GetStopExecutionFlag()) {
|
237
|
+
if (await this.handleStopExecution(rtEvt))
|
238
|
+
break;
|
239
|
+
}
|
240
|
+
}
|
241
|
+
finally {
|
242
|
+
handler.getTask().SetContextTask(handlerContextTask);
|
243
|
+
}
|
244
|
+
if (!propagate)
|
245
|
+
break;
|
246
|
+
if (rtEvtChanged)
|
247
|
+
handler = pos.getNext(rtEvt);
|
248
|
+
else
|
249
|
+
handler = pos.getNext();
|
250
|
+
if (handler !== null)
|
251
|
+
FlowMonitorQueue.Instance.addTaskEvent(rtEvt.getBrkLevel(true), FlowMonitorInterface.FLWMTR_PROPAGATE, task.GetTaskDetails());
|
252
|
+
}
|
253
|
+
if (propagate && !endTaskError)
|
254
|
+
await this.commonHandler(rtEvt);
|
255
|
+
}
|
256
|
+
if (!endTaskError) {
|
257
|
+
await this.commonHandlerAfter(rtEvt, bRcBefore);
|
258
|
+
}
|
259
|
+
if (forceExitDone && this._isHandlingForceExit) {
|
260
|
+
this._isHandlingForceExit = false;
|
261
|
+
await this.handleForceExitAfter(rtEvt);
|
262
|
+
}
|
263
|
+
this.setForceExit(oldForceExit, oldForceExitTask);
|
264
|
+
if (restoreIsForceExit)
|
265
|
+
this._isHandlingForceExit = oldIsHandlingForceExit;
|
266
|
+
}
|
267
|
+
finally {
|
268
|
+
this._currCtrl = restoreCurrCtrl;
|
269
|
+
this._currField = restoreCurrField;
|
270
|
+
this.popRtEvent();
|
271
|
+
}
|
272
|
+
GUIManager.Instance.execGuiCommandQueue();
|
273
|
+
}
|
274
|
+
async simulateSelection(ctrl, val, line, produceClick) {
|
275
|
+
let mgControl = ctrl;
|
276
|
+
let currTask = mgControl.getForm().getTask();
|
277
|
+
let cancelWasRaised = currTask.cancelWasRaised();
|
278
|
+
if (mgControl.Type === MgControlType.CTRL_TYPE_BUTTON) {
|
279
|
+
let aRtEvt = new RunTimeEvent(mgControl);
|
280
|
+
let raiseAt = (await (mgControl.getProp(PropInterface.PROP_TYPE_RAISE_AT)).getValueInt());
|
281
|
+
if (aRtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && (aRtEvt.InternalEvent === InternalInterface.MG_ACT_CANCEL || aRtEvt.InternalEvent === InternalInterface.MG_ACT_RT_QUIT)) {
|
282
|
+
if (raiseAt === RaiseAt.TaskInFocus)
|
283
|
+
currTask = LastFocusedManager.Instance.getLastFocusedTask();
|
284
|
+
cancelWasRaised = currTask.cancelWasRaised();
|
285
|
+
currTask.setCancelWasRaised(true);
|
286
|
+
}
|
287
|
+
if (raiseAt === RaiseAt.TaskInFocus)
|
288
|
+
mgControl.setRtEvtTask(LastFocusedManager.Instance.getLastFocusedTask());
|
289
|
+
}
|
290
|
+
await this.handleFocus(mgControl, line, produceClick, false);
|
291
|
+
currTask.setCancelWasRaised(cancelWasRaised);
|
292
|
+
if (this._stopExecution)
|
293
|
+
return;
|
294
|
+
let controlIsParkable = await mgControl.IsParkable();
|
295
|
+
if (mgControl.Type !== MgControlType.CTRL_TYPE_BUTTON || (mgControl.getField() === null || controlIsParkable)) {
|
296
|
+
if (mgControl.Type === MgControlType.CTRL_TYPE_BUTTON && !controlIsParkable) {
|
297
|
+
let subformTask = mgControl.getForm().getTask();
|
298
|
+
if (subformTask.IsSubForm) {
|
299
|
+
currTask = LastFocusedManager.Instance.getLastFocusedTask();
|
300
|
+
if (subformTask !== currTask && subformTask.pathContains(currTask)) {
|
301
|
+
if (subformTask.getLevel() === Constants.TASK_LEVEL_TASK) {
|
302
|
+
await this.handleInternalEventWithTask(subformTask, InternalInterface.MG_ACT_REC_PREFIX);
|
303
|
+
}
|
304
|
+
await this.HandleNonParkableControls(subformTask);
|
305
|
+
}
|
306
|
+
}
|
307
|
+
}
|
308
|
+
let rtEvt = new RunTimeEvent(mgControl);
|
309
|
+
RuntimeContextBase.Instance.CurrentClickedCtrl = mgControl;
|
310
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_CTRL_HIT);
|
311
|
+
await this.handleEvent(rtEvt, false);
|
312
|
+
if (this._stopExecution)
|
313
|
+
return;
|
314
|
+
}
|
315
|
+
if (mgControl.Type !== MgControlType.CTRL_TYPE_BUTTON)
|
316
|
+
await this.handleSelection(mgControl, line, val);
|
317
|
+
if (this._stopExecution)
|
318
|
+
return;
|
319
|
+
await this.handleMouseUp(mgControl, line, produceClick);
|
320
|
+
}
|
321
|
+
async handleInternalEventWithTask(itask, eventCode) {
|
322
|
+
await this.handleInternalEventWithTaskAndSubformRefresh(itask, eventCode, false);
|
323
|
+
}
|
324
|
+
async handleInternalEventWithTaskAndSubformRefresh(itask, eventCode, subformRefresh) {
|
325
|
+
let task = itask;
|
326
|
+
if (eventCode === InternalInterface.MG_ACT_REC_PREFIX && task.IsSubForm && task.SubformExecMode !== Task_SubformExecModeEnum.FIRST_TIME) {
|
327
|
+
task.SubformExecMode = (subformRefresh ? Task_SubformExecModeEnum.REFRESH : Task_SubformExecModeEnum.SET_FOCUS);
|
328
|
+
}
|
329
|
+
if (subformRefresh)
|
330
|
+
await this.handleInternalEventWithTask(itask, InternalInterface.MG_ACT_POST_REFRESH_BY_PARENT);
|
331
|
+
if (task.DataView.isEmptyDataview()) {
|
332
|
+
if (eventCode === InternalInterface.MG_ACT_REC_PREFIX || eventCode === InternalInterface.MG_ACT_REC_SUFFIX) {
|
333
|
+
if (eventCode === InternalInterface.MG_ACT_REC_PREFIX)
|
334
|
+
await task.emptyDataviewOpen(subformRefresh);
|
335
|
+
else
|
336
|
+
task.emptyDataviewClose();
|
337
|
+
if (task.getForm() !== null) {
|
338
|
+
if (eventCode === InternalInterface.MG_ACT_REC_PREFIX)
|
339
|
+
await task.getForm().RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
340
|
+
task.getForm().SelectRow();
|
341
|
+
}
|
342
|
+
}
|
343
|
+
else
|
344
|
+
await this.handleInternalEventWithTaskAndEventSubtype(task, eventCode, EventSubType.Normal);
|
345
|
+
}
|
346
|
+
else
|
347
|
+
await this.handleInternalEventWithTaskAndEventSubtype(task, eventCode, EventSubType.Normal);
|
348
|
+
}
|
349
|
+
async handleInternalEventWithMgControlBase(ctrl, eventCode) {
|
350
|
+
await this.handleInternalEventWithMgControl(ctrl, eventCode, EventSubType.Normal);
|
351
|
+
}
|
352
|
+
GetStopExecutionFlag() {
|
353
|
+
return this._stopExecution;
|
354
|
+
}
|
355
|
+
getStopExecutionCtrl() {
|
356
|
+
return this._stopExecutionCtrl;
|
357
|
+
}
|
358
|
+
Init() {
|
359
|
+
if (this._initialized) {
|
360
|
+
this._isHandlingForceExit = false;
|
361
|
+
this._forceExit = ForceExit.None;
|
362
|
+
this._forceExitTask = null;
|
363
|
+
this._currField = null;
|
364
|
+
this.setEndOfWork(true);
|
365
|
+
}
|
366
|
+
this._initialized = true;
|
367
|
+
}
|
368
|
+
addInternalEventWithItaskAndCode(itask, code) {
|
369
|
+
this.addGuiTriggeredEventWithTaskAndCodeAndOnMultiMark(itask, code);
|
370
|
+
}
|
371
|
+
addInternalEventWithCtrlAndCode(ctrl, code) {
|
372
|
+
let rtEvt = new RunTimeEvent(ctrl);
|
373
|
+
rtEvt.setInternal(code);
|
374
|
+
this.addToTail(rtEvt);
|
375
|
+
}
|
376
|
+
addInternalEventWithCtrlAndDisplayLineAndCode(ctrl, DisplayLine, code) {
|
377
|
+
let rtEvt = new RunTimeEvent(ctrl, DisplayLine, false);
|
378
|
+
rtEvt.setInternal(code);
|
379
|
+
this.addToTail(rtEvt);
|
380
|
+
}
|
381
|
+
addInternalEventWithCtrlAndCodeAndPriority(ctrl, code, priority) {
|
382
|
+
let rtEvt = new RunTimeEvent(ctrl);
|
383
|
+
rtEvt.setInternal(code);
|
384
|
+
rtEvt.setPriority(priority);
|
385
|
+
this.addToTail(rtEvt);
|
386
|
+
}
|
387
|
+
addGuiTriggeredEventWithTaskAndCodeAndOnMultiMark(itask, code) {
|
388
|
+
let task = itask;
|
389
|
+
let rtEvt = new RunTimeEvent(task);
|
390
|
+
rtEvt.setInternal(code);
|
391
|
+
this.addToTail(rtEvt);
|
392
|
+
}
|
393
|
+
addGuiTriggeredEventWithCtrlAndCodeAndLineAndModifier(ctrl, code, line) {
|
394
|
+
let rtEvt = new RunTimeEvent(ctrl, line, false);
|
395
|
+
rtEvt.setInternal(code);
|
396
|
+
this.addToTail(rtEvt);
|
397
|
+
}
|
398
|
+
addGuiTriggeredEventWithTaskAndCodeAndLine(task, code, line) {
|
399
|
+
let tsk = null;
|
400
|
+
if (task !== null)
|
401
|
+
tsk = task;
|
402
|
+
let rtEvt = new RunTimeEvent(tsk);
|
403
|
+
rtEvt.setInternal(code);
|
404
|
+
rtEvt.DisplayLine = line;
|
405
|
+
this.addToTail(rtEvt);
|
406
|
+
}
|
407
|
+
AddColumnClickEvent(columnCtrl, direction, columnHeader) {
|
408
|
+
let rtEvt = new RunTimeEvent(columnCtrl, direction, 0);
|
409
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_COL_CLICK);
|
410
|
+
let argsList = new Array();
|
411
|
+
argsList[0] = new ExpVal(StorageAttribute.UNICODE, false, columnHeader);
|
412
|
+
let args = new ArgumentsList(argsList);
|
413
|
+
rtEvt.setArgList(args);
|
414
|
+
this.addToTail(rtEvt);
|
415
|
+
}
|
416
|
+
AddRouteEvent(task, code, routerpath, routerOutletName, routeParams) {
|
417
|
+
let rtEvt = new RunTimeEvent(task, true);
|
418
|
+
rtEvt.setInternal(code);
|
419
|
+
let argsList = new Array(2);
|
420
|
+
argsList[0] = new ExpVal(StorageAttribute.ALPHA, false, routerpath);
|
421
|
+
if (routerOutletName === null)
|
422
|
+
routerOutletName = '';
|
423
|
+
argsList[1] = new ExpVal(StorageAttribute.ALPHA, false, routerOutletName);
|
424
|
+
let args = new ArgumentsList(argsList);
|
425
|
+
rtEvt.setArgList(args);
|
426
|
+
rtEvt.setRouteParamList(routeParams);
|
427
|
+
this.addToTail(rtEvt);
|
428
|
+
}
|
429
|
+
AddRouterClosedEvent(task) {
|
430
|
+
let subFormControl = task.getForm().getSubFormCtrl();
|
431
|
+
let rtEvt = new RunTimeEvent(subFormControl.getForm().getTask(), true);
|
432
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_SUBFORM_CLOSE);
|
433
|
+
let argsList = new Array(1);
|
434
|
+
argsList[0] = new ExpVal(StorageAttribute.ALPHA, false, subFormControl.getName());
|
435
|
+
let args = new ArgumentsList(argsList);
|
436
|
+
rtEvt.setArgList(args);
|
437
|
+
EventsManager.Instance.addToTail(rtEvt);
|
438
|
+
}
|
439
|
+
AddLastSavedRouteEvent(srcTask, args) {
|
440
|
+
let rtEvt = new RunTimeEvent(LastFocusedManager.Instance.getLastFocusedTask(), true);
|
441
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_WEBCLIENT_ROUTE);
|
442
|
+
if (srcTask != null) {
|
443
|
+
rtEvt.setTask(srcTask);
|
444
|
+
if (args != null) {
|
445
|
+
rtEvt.setArgList(args);
|
446
|
+
}
|
447
|
+
this.setLastSavedRouteEvent(rtEvt);
|
448
|
+
}
|
449
|
+
}
|
450
|
+
AddExternalValueEvent(ctrl, value, refreshDisplay) {
|
451
|
+
let rtEvt = new RunTimeEvent(ctrl, 0, true);
|
452
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_SET_EXTERNAL_VALUE);
|
453
|
+
rtEvt.setValue(value);
|
454
|
+
let argsList = new Array(1);
|
455
|
+
argsList[0] = new ExpVal(StorageAttribute.BOOLEAN, false, refreshDisplay ? '1' : '0');
|
456
|
+
let args = new ArgumentsList(argsList);
|
457
|
+
rtEvt.setArgList(args);
|
458
|
+
this.addToTail(rtEvt);
|
459
|
+
}
|
460
|
+
addGuiTriggeredEventWithCtrlAndCodeAndLine(ctrl, code, line) {
|
461
|
+
let rtEvt = new RunTimeEvent(ctrl, line, true);
|
462
|
+
rtEvt.setInternal(code);
|
463
|
+
this.addToTail(rtEvt);
|
464
|
+
}
|
465
|
+
addGuiTriggeredEventWithCtrlAndLineAndCodeAndIsProductClick(ctrl, code, line, isProduceClick) {
|
466
|
+
let rtEvt = new RunTimeEvent(ctrl, line, true);
|
467
|
+
rtEvt.setInternal(code);
|
468
|
+
rtEvt.setProduceClick(isProduceClick);
|
469
|
+
this.addToTail(rtEvt);
|
470
|
+
}
|
471
|
+
addGuiTriggeredEventWithCtrlAndCodeAndList(ctrl, code, list) {
|
472
|
+
let rtEvt = new RunTimeEvent(ctrl, list, true);
|
473
|
+
rtEvt.setInternal(code);
|
474
|
+
this.addToTail(rtEvt);
|
475
|
+
}
|
476
|
+
addGuiTriggeredEventWithTaskAndCode(task, code) {
|
477
|
+
let rtEvt = new RunTimeEvent(task, true);
|
478
|
+
rtEvt.setInternal(code);
|
479
|
+
this.addToTail(rtEvt);
|
480
|
+
}
|
481
|
+
addGuiTriggeredEventTaskAndCodeAndRaisedBy(task, code) {
|
482
|
+
this.addGuiTriggeredEventWithTaskAndCode(task, code);
|
483
|
+
}
|
484
|
+
getEvent() {
|
485
|
+
return this._eventsQueue.poll();
|
486
|
+
}
|
487
|
+
getForceExit() {
|
488
|
+
return this._forceExit;
|
489
|
+
}
|
490
|
+
setForceExit(forceExit, task) {
|
491
|
+
this._forceExit = forceExit;
|
492
|
+
this.setForceExitTask(task);
|
493
|
+
}
|
494
|
+
getForceExitTask() {
|
495
|
+
return this._forceExitTask;
|
496
|
+
}
|
497
|
+
setForceExitTask(task) {
|
498
|
+
this._forceExitTask = task;
|
499
|
+
}
|
500
|
+
isForceExitPreRecordUpdate(task) {
|
501
|
+
return this._isHandlingForceExit && this.getForceExit() === ForceExit.PreRecordUpdate && task === this.getForceExitTask();
|
502
|
+
}
|
503
|
+
async ExecuteClientContextInactivityTimer() {
|
504
|
+
let startTime = Misc.getSystemMilliseconds();
|
505
|
+
let clientCtxInactivityTimeout = Environment.Instance.getClientContextInactivityTimeout() * 100;
|
506
|
+
EventsManager.clientInactivityTimerON = true;
|
507
|
+
while (EventsManager.clientInactivityTimerON) {
|
508
|
+
await Thread.Sleep(1000);
|
509
|
+
var timeLapsed = Misc.getSystemMilliseconds() - startTime;
|
510
|
+
if (EventsManager.clientContextInactivityTimerAborted || timeLapsed >= clientCtxInactivityTimeout) {
|
511
|
+
EventsManager.clientInactivityTimerON = false;
|
512
|
+
}
|
513
|
+
}
|
514
|
+
}
|
515
|
+
async CheckAndShowSpinner(show) {
|
516
|
+
let sendCommand = false;
|
517
|
+
if (this.getLastRtEvent() !== null && this.getLastRtEvent().getPriority() === Priority.LOWEST)
|
518
|
+
show = false;
|
519
|
+
if (show != this.isSpinnerShown) {
|
520
|
+
if (show) {
|
521
|
+
if (Misc.getSystemMilliseconds() - this.GetEventTime() > 1000) {
|
522
|
+
sendCommand = true;
|
523
|
+
EventsManager.clientBusyTimeStart = Misc.getSystemMilliseconds();
|
524
|
+
}
|
525
|
+
}
|
526
|
+
else
|
527
|
+
sendCommand = true;
|
528
|
+
if (sendCommand) {
|
529
|
+
Commands.addShowSpinner(show);
|
530
|
+
Commands.beginInvoke();
|
531
|
+
await Thread.Sleep(50);
|
532
|
+
this.isSpinnerShown = show;
|
533
|
+
if (!this.isSpinnerShown) {
|
534
|
+
let totalClientBusyTime = Misc.getSystemMilliseconds() - EventsManager.clientBusyTimeStart;
|
535
|
+
this.SpinnerStopped.next(totalClientBusyTime);
|
536
|
+
EventsManager.clientBusyTimeStart = 0;
|
537
|
+
}
|
538
|
+
}
|
539
|
+
}
|
540
|
+
}
|
541
|
+
async EventsLoop(mgData) {
|
542
|
+
let savedAllowEvents = this.getAllowEvents();
|
543
|
+
this.setAllowEvents(EventsAllowedType.ALL);
|
544
|
+
this.pushNewExecStacks();
|
545
|
+
while (!mgData.IsAborting) {
|
546
|
+
await this.CheckAndShowSpinner(false);
|
547
|
+
await this._eventsQueue.waitForElement();
|
548
|
+
await this.handleEvents(mgData, 0);
|
549
|
+
if (!mgData.IsAborting)
|
550
|
+
await this.checkParkability();
|
551
|
+
}
|
552
|
+
this.popNewExecStacks();
|
553
|
+
this.setAllowEvents(savedAllowEvents);
|
554
|
+
}
|
555
|
+
async NonInteractiveEventsLoop(mgData, taskBase) {
|
556
|
+
let task = taskBase;
|
557
|
+
let savedAllowEvents = this.getAllowEvents();
|
558
|
+
this.setNonInteractiveAllowEvents(await task.isAllowEvents());
|
559
|
+
this.pushNewExecStacks();
|
560
|
+
while (!mgData.IsAborting) {
|
561
|
+
if (task.getMode() === Constants.TASK_MODE_DELETE)
|
562
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_CYCLE_NEXT_DELETE_REC);
|
563
|
+
else
|
564
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_CYCLE_NEXT_REC);
|
565
|
+
await Thread.Sleep(10);
|
566
|
+
if (!mgData.IsAborting && await task.isAllowEvents())
|
567
|
+
await this.handleEvents(mgData, 1);
|
568
|
+
}
|
569
|
+
this.popNewExecStacks();
|
570
|
+
this.setAllowEvents(savedAllowEvents);
|
571
|
+
}
|
572
|
+
async handleEvents(baseMgDataOrHandlersTab, eventsToHandleCntOrRtEvt) {
|
573
|
+
if ((baseMgDataOrHandlersTab === null || baseMgDataOrHandlersTab instanceof MGData) && (eventsToHandleCntOrRtEvt === null || eventsToHandleCntOrRtEvt.constructor === Number)) {
|
574
|
+
await this.handleEvents_0(baseMgDataOrHandlersTab, eventsToHandleCntOrRtEvt);
|
575
|
+
return;
|
576
|
+
}
|
577
|
+
await this.handleEvents_1(baseMgDataOrHandlersTab, eventsToHandleCntOrRtEvt);
|
578
|
+
}
|
579
|
+
async handleEvents_0(baseMgData, eventsToHandleCnt) {
|
580
|
+
let task = null;
|
581
|
+
let delta = 0;
|
582
|
+
let eventsPolledCnt = 0;
|
583
|
+
this.setStopExecution(false);
|
584
|
+
while (!this._eventsQueue.isEmpty() && !this._stopExecution && (eventsToHandleCnt === 0 || eventsPolledCnt < eventsToHandleCnt)) {
|
585
|
+
let rtEvt = this.getEvent();
|
586
|
+
if (rtEvt !== null && rtEvt.isGuiTriggeredEvent()) {
|
587
|
+
delta = Misc.getSystemMilliseconds();
|
588
|
+
this._currKbdItem = null;
|
589
|
+
let blockedByModalWindow = rtEvt.isBlockedByModalWindow(baseMgData);
|
590
|
+
if (blockedByModalWindow && rtEvt.getInternalCode() !== InternalInterface.MG_ACT_TIMER) {
|
591
|
+
continue;
|
592
|
+
}
|
593
|
+
if (!rtEvt.isIdleTimer() && !blockedByModalWindow && rtEvt.getInternalCode() !== InternalInterface.MG_ACT_ENABLE_EVENTS && rtEvt.getInternalCode() !== InternalInterface.MG_ACT_DISABLE_EVENTS && rtEvt.getTask() !== null && !rtEvt.getTask().getMGData().IsAborting) {
|
594
|
+
MGDataCollection.Instance.currMgdID = rtEvt.getTask().getMGData().GetId();
|
595
|
+
}
|
596
|
+
}
|
597
|
+
let currMgd = MGDataCollection.Instance.getCurrMGData();
|
598
|
+
if (currMgd !== null) {
|
599
|
+
while (currMgd !== null && currMgd.IsAborting) {
|
600
|
+
currMgd = currMgd.getParentMGdata();
|
601
|
+
if (currMgd !== null)
|
602
|
+
MGDataCollection.Instance.currMgdID = MGDataCollection.Instance.getMgDataIdx(currMgd);
|
603
|
+
}
|
604
|
+
}
|
605
|
+
else {
|
606
|
+
task = rtEvt.getTask();
|
607
|
+
while (currMgd === null && task !== null && task.getParent() !== null) {
|
608
|
+
task = task.getParent();
|
609
|
+
currMgd = task.getMGData();
|
610
|
+
if (currMgd.IsAborting)
|
611
|
+
currMgd = null;
|
612
|
+
if (currMgd !== null)
|
613
|
+
MGDataCollection.Instance.currMgdID = MGDataCollection.Instance.getMgDataIdx(currMgd);
|
614
|
+
}
|
615
|
+
}
|
616
|
+
if (currMgd === null)
|
617
|
+
break;
|
618
|
+
if (rtEvt.getTask() === null) {
|
619
|
+
task = LastFocusedManager.Instance.getLastFocusedTask();
|
620
|
+
while (task !== null && (task.isAborting() || task.InEndTask))
|
621
|
+
task = task.getParent();
|
622
|
+
if (task !== null) {
|
623
|
+
rtEvt.setCtrl(task.getLastParkedCtrl());
|
624
|
+
rtEvt.setTask(task);
|
625
|
+
}
|
626
|
+
}
|
627
|
+
else
|
628
|
+
task = rtEvt.getTask();
|
629
|
+
if (task !== null) {
|
630
|
+
await this.handleEvent(rtEvt, false);
|
631
|
+
}
|
632
|
+
GUIManager.Instance.execGuiCommandQueue();
|
633
|
+
this._currCtrl = null;
|
634
|
+
if (task !== null)
|
635
|
+
await Task.CommandsProcessor.SendMonitorOnly();
|
636
|
+
else {
|
637
|
+
await Task.CommandsProcessor.SendMonitorOnly();
|
638
|
+
}
|
639
|
+
if (rtEvt !== null && rtEvt.isGuiTriggeredEvent()) {
|
640
|
+
if (delta > 0) {
|
641
|
+
delta = Misc.getSystemMilliseconds() - delta;
|
642
|
+
}
|
643
|
+
}
|
644
|
+
if (eventsToHandleCnt > 0 && rtEvt !== null && rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && rtEvt.InternalEvent < InternalInterface.MG_ACT_TOT_CNT)
|
645
|
+
eventsPolledCnt++;
|
646
|
+
}
|
647
|
+
}
|
648
|
+
async handleStopExecution(rtEvt) {
|
649
|
+
let stop = false;
|
650
|
+
if (!this.GetStopExecutionFlag())
|
651
|
+
return stop;
|
652
|
+
let task = rtEvt.getTask();
|
653
|
+
let currCtrl = rtEvt.Control;
|
654
|
+
let lastParkedCtrl = LastFocusedManager.getLastFocusedControl();
|
655
|
+
let endTaskDueToVerifyError = false;
|
656
|
+
if (rtEvt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
|
657
|
+
switch (rtEvt.getInternalCode()) {
|
658
|
+
case InternalInterface.MG_ACT_TASK_PREFIX:
|
659
|
+
endTaskDueToVerifyError = true;
|
660
|
+
break;
|
661
|
+
case InternalInterface.MG_ACT_REC_PREFIX:
|
662
|
+
endTaskDueToVerifyError = true;
|
663
|
+
break;
|
664
|
+
case InternalInterface.MG_ACT_REC_SUFFIX:
|
665
|
+
this.setStopExecutionCtrl(null);
|
666
|
+
this.setStopExecutionCtrl(task.getLastParkedCtrl());
|
667
|
+
break;
|
668
|
+
case InternalInterface.MG_ACT_CTRL_PREFIX:
|
669
|
+
this.setStopExecution(false);
|
670
|
+
task.InCtrlPrefix = false;
|
671
|
+
if (lastParkedCtrl === null) {
|
672
|
+
task.setCurrField(null);
|
673
|
+
this.setStopExecutionCtrl(null);
|
674
|
+
this.setStopExecutionCtrl(currCtrl);
|
675
|
+
await this.HandleNonParkableControls(task);
|
676
|
+
}
|
677
|
+
else {
|
678
|
+
task.setCurrField(lastParkedCtrl.getField());
|
679
|
+
await FocusManager.SetFocus(lastParkedCtrl, -1);
|
680
|
+
}
|
681
|
+
this.setStopExecution(true);
|
682
|
+
break;
|
683
|
+
case InternalInterface.MG_ACT_CTRL_SUFFIX:
|
684
|
+
currCtrl.setInControlSuffix(false);
|
685
|
+
break;
|
686
|
+
}
|
687
|
+
if (endTaskDueToVerifyError) {
|
688
|
+
await task.endTask(true, false, true);
|
689
|
+
stop = true;
|
690
|
+
}
|
691
|
+
}
|
692
|
+
return stop;
|
693
|
+
}
|
694
|
+
async handleForceExitBefore(evt, rtEvt) {
|
695
|
+
let forceExit = evt.UserEvt.ForceExit;
|
696
|
+
let isNewRec = false;
|
697
|
+
let oldIdx = 0;
|
698
|
+
if (forceExit === ForceExit.None || rtEvt.isImmediate())
|
699
|
+
return false;
|
700
|
+
this._isHandlingForceExit = true;
|
701
|
+
let task = rtEvt.getTask();
|
702
|
+
let oldRec = task.DataView.getCurrRec();
|
703
|
+
if (oldRec !== null && oldRec.getMode() === DataModificationTypes.Insert && oldRec.isNewRec()) {
|
704
|
+
isNewRec = true;
|
705
|
+
oldIdx = oldRec.getId();
|
706
|
+
}
|
707
|
+
if (forceExit !== ForceExit.Editing && task.getLevel() === Constants.TASK_LEVEL_CONTROL) {
|
708
|
+
let ctrl = task.getLastParkedCtrl();
|
709
|
+
if (ctrl !== null)
|
710
|
+
await this.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
|
711
|
+
}
|
712
|
+
if ((forceExit === ForceExit.PreRecordUpdate || forceExit === ForceExit.PostRecordUpdate) && task.getLevel() === Constants.TASK_LEVEL_RECORD) {
|
713
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
714
|
+
if (task.getMode() === Constants.TASK_MODE_CREATE && !this._stopExecution)
|
715
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
716
|
+
let currRec = task.DataView.getCurrRec();
|
717
|
+
if (currRec !== null && this._stopExecution && isNewRec && oldIdx === currRec.getId() && task.getMode() === Constants.TASK_MODE_CREATE) {
|
718
|
+
currRec.clearMode();
|
719
|
+
currRec.restart(DataModificationTypes.Insert);
|
720
|
+
}
|
721
|
+
}
|
722
|
+
if (forceExit === ForceExit.PostRecordUpdate && !this._stopExecution) {
|
723
|
+
if (task.getLevel() === Constants.TASK_LEVEL_TASK)
|
724
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
725
|
+
}
|
726
|
+
if (forceExit === ForceExit.Editing) {
|
727
|
+
let evtCtrl = rtEvt.Control;
|
728
|
+
if (evtCtrl !== null && evtCtrl.getField() !== null) {
|
729
|
+
let ctrlVal = Manager.GetCtrlVal(evtCtrl);
|
730
|
+
await evtCtrl.validateAndSetValue(ctrlVal, true);
|
731
|
+
}
|
732
|
+
}
|
733
|
+
return true;
|
734
|
+
}
|
735
|
+
async handleForceExitAfter(rtEvt) {
|
736
|
+
let forceExit = rtEvt.UserEvt.ForceExit;
|
737
|
+
let task = rtEvt.getTask();
|
738
|
+
if (forceExit === ForceExit.PreRecordUpdate) {
|
739
|
+
await this.commitRecord(task, true);
|
740
|
+
if (!task.transactionFailed(ConstInterface.TRANS_RECORD_PREFIX) && !task.isAborting()) {
|
741
|
+
if (await task.evalEndCond(ConstInterface.END_COND_EVAL_AFTER))
|
742
|
+
await task.endTask(true, false, false);
|
743
|
+
}
|
744
|
+
}
|
745
|
+
if (forceExit !== ForceExit.PostRecordUpdate) {
|
746
|
+
task = rtEvt.getTask();
|
747
|
+
if (task.getLevel() === Constants.TASK_LEVEL_TASK)
|
748
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
749
|
+
}
|
750
|
+
let ctrl = LastFocusedManager.getLastFocusedControl();
|
751
|
+
if (ctrl !== null && forceExit !== ForceExit.Editing) {
|
752
|
+
await this.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_CTRL_PREFIX);
|
753
|
+
}
|
754
|
+
if (forceExit === ForceExit.Editing) {
|
755
|
+
let evtCtrl = rtEvt.Control;
|
756
|
+
if (evtCtrl !== null && evtCtrl.getField() !== null)
|
757
|
+
await evtCtrl.getField().updateDisplay();
|
758
|
+
}
|
759
|
+
}
|
760
|
+
async handleEvents_1(handlersTab, rtEvt) {
|
761
|
+
try {
|
762
|
+
this.pushRtEvent(rtEvt);
|
763
|
+
for (let i = 0; i < handlersTab.getSize(); i++) {
|
764
|
+
let handler = handlersTab.getHandler(i);
|
765
|
+
if (rtEvt.getType() === ConstInterface.EVENT_TYPE_EXPRESSION || handler.isSpecificHandlerOf(rtEvt) || handler.isNonSpecificHandlerOf(rtEvt) || handler.isGlobalHandlerOf(rtEvt)) {
|
766
|
+
await handler.execute(rtEvt, false, false);
|
767
|
+
}
|
768
|
+
}
|
769
|
+
}
|
770
|
+
finally {
|
771
|
+
this.popRtEvent();
|
772
|
+
}
|
773
|
+
}
|
774
|
+
async handleKeyDown(task, ctrl, evt) {
|
775
|
+
let kbdItem = evt.getKbdItmAlways();
|
776
|
+
let keyCode = kbdItem.getKeyCode();
|
777
|
+
this._currKbdItem = kbdItem;
|
778
|
+
if (evt.IgnoreSpecifiedControl) {
|
779
|
+
ctrl = this.getCurrCtrl();
|
780
|
+
task = (((ctrl.getForm().getTask() instanceof Task) ? ctrl.getForm().getTask() : null));
|
781
|
+
if (ctrl.Type !== MgControlType.CTRL_TYPE_TEXT)
|
782
|
+
return;
|
783
|
+
}
|
784
|
+
Logger.Instance.WriteDevToLog('Start handling KEYDOWN event. Key code: ' + keyCode);
|
785
|
+
try {
|
786
|
+
if (this._currKbdItem.equals(this.KBI_DOWN) || this._currKbdItem.equals(this.KBI_UP)) {
|
787
|
+
if (ctrl !== null && (ctrl.Type === MgControlType.CTRL_TYPE_LIST || ctrl.Type === MgControlType.CTRL_TYPE_RADIO))
|
788
|
+
return;
|
789
|
+
}
|
790
|
+
let rtEvt = new RunTimeEvent(task, ctrl);
|
791
|
+
rtEvt.setSystem(this._currKbdItem);
|
792
|
+
rtEvt.setEditParms(evt.getStartSelection(), evt.getEndSelection(), evt.getValue());
|
793
|
+
try {
|
794
|
+
await this.handleEvent(rtEvt, false);
|
795
|
+
}
|
796
|
+
finally {
|
797
|
+
if (this._stopExecution) {
|
798
|
+
let returnToCtrl = MgControl.ReturnToCtrl;
|
799
|
+
if (returnToCtrl !== null && MgControl.validReturnToCtrl())
|
800
|
+
returnToCtrl.getForm().getTask().setLastParkedCtrl(returnToCtrl);
|
801
|
+
}
|
802
|
+
}
|
803
|
+
let mgd = MGDataCollection.Instance.getCurrMGData();
|
804
|
+
if (mgd !== null && !mgd.IsAborting)
|
805
|
+
await this.handleExpressionHandlers();
|
806
|
+
Logger.Instance.WriteDevToLog('End handling KEYDOWN event. Key code: ' + keyCode);
|
807
|
+
if (ctrl !== null && ctrl.IsRepeatable && ctrl === MgControl.ReturnToCtrl) {
|
808
|
+
await ctrl.getForm().bringRecordToPage();
|
809
|
+
}
|
810
|
+
}
|
811
|
+
finally {
|
812
|
+
}
|
813
|
+
}
|
814
|
+
async handleSelection(ctrl, line, val) {
|
815
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_TAB || ctrl.Type === MgControlType.CTRL_TYPE_CHECKBOX || ctrl.Type === MgControlType.CTRL_TYPE_RADIO || ctrl.Type === MgControlType.CTRL_TYPE_COMBO || ctrl.Type === MgControlType.CTRL_TYPE_LIST) {
|
816
|
+
let checkFocus = (ctrl.Type !== MgControlType.CTRL_TYPE_TAB && ctrl.Type !== MgControlType.CTRL_TYPE_CHECKBOX);
|
817
|
+
let allowSelection = (checkFocus ? (ctrl.getForm().getTask().getLastParkedCtrl() === ctrl) : true);
|
818
|
+
if (!allowSelection || !ctrl.isModifiable() || !await ctrl.IsParkable())
|
819
|
+
await ctrl.restoreOldValue();
|
820
|
+
else {
|
821
|
+
if (ctrl.isChoiceControl())
|
822
|
+
Commands.setGetSuggestedValueOfChoiceControlOnTagData(ctrl, ctrl.IsRepeatable ? line : 0, true);
|
823
|
+
if (ctrl.isDifferentValue(val, ctrl.IsNull, true)) {
|
824
|
+
ctrl.ModifiedByUser = true;
|
825
|
+
await this.handleCtrlModify(ctrl, InternalInterface.MG_ACT_SELECTION);
|
826
|
+
}
|
827
|
+
if (ctrl.isChoiceControl())
|
828
|
+
Commands.setGetSuggestedValueOfChoiceControlOnTagData(ctrl, ctrl.IsRepeatable ? line : 0, false);
|
829
|
+
if (!ctrl.IsMultipleSelectionListBox())
|
830
|
+
await ctrl.validateAndSetValue(val, true);
|
831
|
+
}
|
832
|
+
}
|
833
|
+
}
|
834
|
+
async handleMouseUp(ctrl, line, produceClick) {
|
835
|
+
if (ctrl === null)
|
836
|
+
return;
|
837
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_RADIO)
|
838
|
+
RuntimeContextBase.Instance.CurrentClickedRadio = ctrl;
|
839
|
+
try {
|
840
|
+
if (ctrl.Type !== MgControlType.CTRL_TYPE_TABLE) {
|
841
|
+
if (!await ctrl.checkPropWithLine(PropInterface.PROP_TYPE_ENABLED, true, line)) {
|
842
|
+
return;
|
843
|
+
}
|
844
|
+
let canGotoCtrl = this.canGoToControl(ctrl, true);
|
845
|
+
let StopFocus = ctrl.isFocusedStopExecution();
|
846
|
+
let returnToCtrl = MgControl.ReturnToCtrl;
|
847
|
+
if ((!canGotoCtrl || ((this._stopExecution || StopFocus) && returnToCtrl !== ctrl)) && returnToCtrl !== null) {
|
848
|
+
MGDataCollection.Instance.currMgdID = returnToCtrl.getForm().getTask().getMgdID();
|
849
|
+
if (returnToCtrl.IsRepeatable)
|
850
|
+
await returnToCtrl.getForm().bringRecordToPage();
|
851
|
+
await FocusManager.SetFocus(returnToCtrl, -1);
|
852
|
+
returnToCtrl.getForm().getTask().setLastParkedCtrl(returnToCtrl);
|
853
|
+
}
|
854
|
+
if (this._stopExecution || StopFocus)
|
855
|
+
return;
|
856
|
+
}
|
857
|
+
if (produceClick && (ctrl.Type === MgControlType.CTRL_TYPE_BUTTON || ctrl.Type === MgControlType.CTRL_TYPE_CHECKBOX || ctrl.Type === MgControlType.CTRL_TYPE_LIST)) {
|
858
|
+
let rtEvt = new RunTimeEvent(ctrl);
|
859
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_WEB_CLICK);
|
860
|
+
this.addToTail(rtEvt);
|
861
|
+
}
|
862
|
+
}
|
863
|
+
finally {
|
864
|
+
RuntimeContextBase.Instance.CurrentClickedRadio = null;
|
865
|
+
}
|
866
|
+
}
|
867
|
+
checkAndSaveRouteEventIfCtxRemovedFromSrvr(aRtEvt) {
|
868
|
+
if (aRtEvt.getType() == ConstInterface.EVENT_TYPE_INTERNAL && aRtEvt.getInternalCode() ==
|
869
|
+
InternalInterface.MG_ACT_WEBCLIENT_ROUTE && RuntimeContextBase.Instance.RemovedContextFromServer) {
|
870
|
+
this.setLastSavedRouteEvent(aRtEvt);
|
871
|
+
}
|
872
|
+
}
|
873
|
+
async handleFocus(ctrl, line, onClick, shouldHandleZoom) {
|
874
|
+
try {
|
875
|
+
if (ctrl.isStatic())
|
876
|
+
return;
|
877
|
+
if (ctrl !== this._lastFailedFocusedControl && ctrl.HasExpOrParentTaskField()) {
|
878
|
+
if (ctrl.isListBox() || ctrl.isCheckBox() || ctrl.isComboBox() || ctrl.isTextControl() || ctrl.isRadio() || ctrl.isTabControl()) {
|
879
|
+
Logger.Instance.WriteErrorToLog(NString.Format('Control either has expression or has parent task variable attached to it. Failed to park on control with name: {0}', ctrl.Name));
|
880
|
+
FocusManager.SetFocus(LastFocusedManager.Instance.getLastFocusedTask(), LastFocusedManager.getLastFocusedControl(), 0, LastFocusedManager.getLastFocusedControl() === null ? true : false);
|
881
|
+
this._lastFailedFocusedControl = ctrl;
|
882
|
+
return;
|
883
|
+
}
|
884
|
+
}
|
885
|
+
this._lastFailedFocusedControl = null;
|
886
|
+
if (onClick)
|
887
|
+
RuntimeContextBase.Instance.CurrentClickedCtrl = ctrl;
|
888
|
+
let prevCtrl = LastFocusedManager.getLastFocusedControl();
|
889
|
+
if (ctrl === prevCtrl && !ctrl.isRepeatable()) {
|
890
|
+
await ctrl.getForm().bringRecordToPage();
|
891
|
+
await this.HandleZoomIfNeeded(ctrl, line, shouldHandleZoom);
|
892
|
+
let rtEvnt = this.getLastRtEvent();
|
893
|
+
if (rtEvnt != null && rtEvnt.ShouldHandleZoom)
|
894
|
+
FocusManager.SetFocus(ctrl, -1);
|
895
|
+
return;
|
896
|
+
}
|
897
|
+
let prevTask = LastFocusedManager.Instance.getLastFocusedTask();
|
898
|
+
if (ctrl === null || ctrl.Type === MgControlType.CTRL_TYPE_TABLE) {
|
899
|
+
if (prevCtrl === null)
|
900
|
+
await this.HandleNonParkableControls(ctrl.getForm().getTask());
|
901
|
+
return;
|
902
|
+
}
|
903
|
+
let currTask;
|
904
|
+
if ((ctrl.Type === MgControlType.CTRL_TYPE_BUTTON) && ((await (ctrl.getProp(PropInterface.PROP_TYPE_RAISE_AT)).getValueInt()) === RaiseAt.TaskInFocus))
|
905
|
+
currTask = prevTask;
|
906
|
+
else
|
907
|
+
currTask = ctrl.getForm().getTask();
|
908
|
+
let canGotoCtrl = this.canGoToControl(ctrl, onClick);
|
909
|
+
if (canGotoCtrl) {
|
910
|
+
if (this.guiPendingEvent != null)
|
911
|
+
return;
|
912
|
+
let handled = await this.HandleSubformModality(ctrl, prevTask, currTask);
|
913
|
+
if (handled)
|
914
|
+
return;
|
915
|
+
let eventLine = (ctrl.isRepeatable() || ctrl.isRadio()) ? line : Int32.MinValue;
|
916
|
+
let rtEvt = new RunTimeEvent(ctrl, eventLine);
|
917
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_CTRL_PREFIX);
|
918
|
+
await this.handleEvent(rtEvt, false);
|
919
|
+
}
|
920
|
+
else if (prevCtrl !== null) {
|
921
|
+
if (!prevCtrl.isModifiable()) {
|
922
|
+
if (prevCtrl.isChoiceControl())
|
923
|
+
await prevCtrl.restoreOldValue();
|
924
|
+
}
|
925
|
+
else if (!currTask.cancelWasRaised()) {
|
926
|
+
let newVal = Manager.GetCtrlVal(prevCtrl);
|
927
|
+
if (!await prevCtrl.validateAndSetValue(newVal, true))
|
928
|
+
this.setStopExecution(true);
|
929
|
+
}
|
930
|
+
MgControl.ReturnToCtrl = prevCtrl;
|
931
|
+
}
|
932
|
+
else
|
933
|
+
await this.HandleNonParkableControls(ctrl.getForm().getTask());
|
934
|
+
if (!this._stopExecution && MgControl.ReturnToCtrl === ctrl) {
|
935
|
+
LastFocusedManager.setLastFocusedControl(ctrl.getForm().getTask(), ctrl);
|
936
|
+
await this.HandleZoomIfNeeded(ctrl, line, shouldHandleZoom);
|
937
|
+
}
|
938
|
+
return;
|
939
|
+
}
|
940
|
+
finally {
|
941
|
+
ctrl.setFocusedStopExecution(this._stopExecution);
|
942
|
+
if (this._stopExecution) {
|
943
|
+
{
|
944
|
+
let returnToCtrl = MgControl.ReturnToCtrl;
|
945
|
+
if (returnToCtrl !== null) {
|
946
|
+
MGDataCollection.Instance.currMgdID = returnToCtrl.getForm().getTask().getMgdID();
|
947
|
+
await FocusManager.SetFocus(returnToCtrl, -1);
|
948
|
+
returnToCtrl.getForm().getTask().setLastParkedCtrl(returnToCtrl);
|
949
|
+
}
|
950
|
+
}
|
951
|
+
}
|
952
|
+
}
|
953
|
+
}
|
954
|
+
async HandleSubformModality(ctrl, prevTask, currTask) {
|
955
|
+
let handledSubformModality = false;
|
956
|
+
let length = prevTask.getMGData().getTasksCount();
|
957
|
+
let topTask = prevTask.getMGData().getTask(length - 1);
|
958
|
+
if (currTask == prevTask || prevTask != topTask) {
|
959
|
+
if (topTask != null && prevTask != topTask && topTask.IsSubForm) {
|
960
|
+
let subformCtrl = topTask.getForm().getSubFormCtrl();
|
961
|
+
if (subformCtrl.IsModal())
|
962
|
+
prevTask = topTask;
|
963
|
+
}
|
964
|
+
}
|
965
|
+
if (prevTask != ctrl.getForm().getTask() && prevTask.getIsDestinationCall()) {
|
966
|
+
if (!currTask.isDescendentOf(prevTask)) {
|
967
|
+
let subformCtrl = prevTask.getForm().getSubFormCtrl();
|
968
|
+
if (!subformCtrl.IsModal() && !currTask.getIsDestinationCall())
|
969
|
+
subformCtrl = prevTask.GetSubformModalParentTask();
|
970
|
+
if (subformCtrl != null && (ctrl != subformCtrl) && subformCtrl.IsModal()) {
|
971
|
+
await this.performSubformClose(subformCtrl);
|
972
|
+
if (!this._stopExecution)
|
973
|
+
this.guiPendingEvent = this.getLastRtEvent();
|
974
|
+
handledSubformModality = true;
|
975
|
+
}
|
976
|
+
}
|
977
|
+
}
|
978
|
+
return handledSubformModality;
|
979
|
+
}
|
980
|
+
async handleFocusOnNonMagicControl(ctrl) {
|
981
|
+
try {
|
982
|
+
await EventsManager.Instance.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
|
983
|
+
}
|
984
|
+
finally {
|
985
|
+
ctrl.setFocusedStopExecution(this._stopExecution);
|
986
|
+
if (this._stopExecution) {
|
987
|
+
{
|
988
|
+
let returnToCtrl = MgControl.ReturnToCtrl;
|
989
|
+
if (returnToCtrl !== null) {
|
990
|
+
MGDataCollection.Instance.currMgdID = returnToCtrl.getForm().getTask().getMgdID();
|
991
|
+
await FocusManager.SetFocus(returnToCtrl, -1);
|
992
|
+
returnToCtrl.getForm().getTask().setLastParkedCtrl(returnToCtrl);
|
993
|
+
}
|
994
|
+
}
|
995
|
+
}
|
996
|
+
}
|
997
|
+
}
|
998
|
+
async HandleZoomIfNeeded(ctrl, line, shouldHandleZoom) {
|
999
|
+
if (shouldHandleZoom) {
|
1000
|
+
var rtEvt = new RunTimeEvent(ctrl, line, true);
|
1001
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_ZOOM);
|
1002
|
+
await this.handleEvent(rtEvt, false);
|
1003
|
+
}
|
1004
|
+
}
|
1005
|
+
canGoToControl(ctrl, onClick) {
|
1006
|
+
if (onClick && (ctrl.Type === MgControlType.CTRL_TYPE_SUBFORM || ctrl.Type === MgControlType.CTRL_TYPE_BROWSER))
|
1007
|
+
return false;
|
1008
|
+
let canGotoCtrl = true;
|
1009
|
+
let currTask = ctrl.getForm().getTask();
|
1010
|
+
let lastTask = LastFocusedManager.Instance.getLastFocusedTask();
|
1011
|
+
if (!currTask.IsInteractive || (lastTask != null && lastTask.getLastParkedCtrl() != null &&
|
1012
|
+
lastTask.cancelWasRaised()))
|
1013
|
+
return false;
|
1014
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_IMAGE && !ctrl.IsRepeatable)
|
1015
|
+
canGotoCtrl = false;
|
1016
|
+
return canGotoCtrl;
|
1017
|
+
}
|
1018
|
+
async handleTimer(evt) {
|
1019
|
+
evt.setType(ConstInterface.EVENT_TYPE_TIMER);
|
1020
|
+
if (evt.isIdleTimer()) {
|
1021
|
+
await this.handleExpressionHandlers();
|
1022
|
+
await this.handleContextInactivityAlert(evt);
|
1023
|
+
}
|
1024
|
+
else {
|
1025
|
+
let mgd = MGDataCollection.Instance.getMGData(evt.getMgdID());
|
1026
|
+
await this.handleEvents(mgd.getTimerHandlers(), evt);
|
1027
|
+
}
|
1028
|
+
}
|
1029
|
+
async handleContextInactivityAlert(evt) {
|
1030
|
+
let timeNow = Misc.getSystemMilliseconds();
|
1031
|
+
let mgd = evt.getTask().getMGData();
|
1032
|
+
let lastRequestTime = RemoteCommandsProcessor.GetInstance().GetLastRequestTime;
|
1033
|
+
let contextInactivityTimeout = Environment.Instance.getContextInactivityTimeout() / 10;
|
1034
|
+
let contextInactivityWarningTime = Environment.Instance.getContextInactivityWarningTime() / 10;
|
1035
|
+
let idleTime = (timeNow - lastRequestTime) / 1000;
|
1036
|
+
if (contextInactivityTimeout == 0 || contextInactivityWarningTime == 0)
|
1037
|
+
return;
|
1038
|
+
if (EventsManager.userGrantedForContextActivity && idleTime >= (contextInactivityTimeout - contextInactivityWarningTime)) {
|
1039
|
+
let userConfirmation = await GUIManager.Instance.MessageBox(this.confirmationDialogTitle, this.confirmationDialogMsg, Styles.MSGBOX_BUTTON_YES_NO);
|
1040
|
+
if (userConfirmation == Styles.MSGBOX_RESULT_YES) {
|
1041
|
+
let cmd = CommandFactory.CreateContextTimeoutResetEventCommand();
|
1042
|
+
mgd.CmdsToServer.Add(cmd);
|
1043
|
+
await RemoteCommandsProcessor.GetInstance().Execute(CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS);
|
1044
|
+
}
|
1045
|
+
else {
|
1046
|
+
EventsManager.userGrantedForContextActivity = false;
|
1047
|
+
}
|
1048
|
+
}
|
1049
|
+
}
|
1050
|
+
async handleExpressionHandlers() {
|
1051
|
+
let rtEvt = new RunTimeEvent(LastFocusedManager.Instance.getLastFocusedTask(), LastFocusedManager.getLastFocusedControl());
|
1052
|
+
rtEvt.setExpression(null);
|
1053
|
+
rtEvt.setMainPrgCreator(rtEvt.getTask());
|
1054
|
+
for (let i = 0; i < MGDataCollection.Instance.getSize(); i++) {
|
1055
|
+
let mgd = MGDataCollection.Instance.getMGData(i);
|
1056
|
+
if (mgd !== null && !mgd.IsAborting)
|
1057
|
+
await this.handleEvents(mgd.getExpHandlers(), rtEvt);
|
1058
|
+
}
|
1059
|
+
}
|
1060
|
+
handleResize(ctrl, rowsInPage) {
|
1061
|
+
ctrl.getForm().setRowsInPage(rowsInPage);
|
1062
|
+
}
|
1063
|
+
async handleRowDataCurPage(table, desiredTopIndex, sendAll, lastFocusedVal) {
|
1064
|
+
let form = table.getForm();
|
1065
|
+
await form.setRowData(desiredTopIndex, sendAll);
|
1066
|
+
}
|
1067
|
+
async handleTransferDataToGui(ctrl) {
|
1068
|
+
let form = ctrl.getForm();
|
1069
|
+
await form.transferDataToGui();
|
1070
|
+
}
|
1071
|
+
async fetchRecordsAheadFromServer(ctrl) {
|
1072
|
+
let form = ctrl.getForm();
|
1073
|
+
await form.FetchRecordsAheadFromServer();
|
1074
|
+
}
|
1075
|
+
handleEnableEvents(evt, enable) {
|
1076
|
+
evt.getTask().ActionManager.enableList(evt.getActEnableList(), enable, true);
|
1077
|
+
}
|
1078
|
+
async handleCtrlPrefix(evt) {
|
1079
|
+
let task = evt.getTask();
|
1080
|
+
let currClickedCtrl = RuntimeContextBase.Instance.CurrentClickedCtrl;
|
1081
|
+
let form = task.getForm();
|
1082
|
+
let displayLine = evt.getDisplayLine();
|
1083
|
+
let ctrl = evt.Control;
|
1084
|
+
if (form.isLineMode()) {
|
1085
|
+
if (displayLine === Int32.MinValue || ctrl.isRadio())
|
1086
|
+
displayLine = form.DisplayLine;
|
1087
|
+
}
|
1088
|
+
else
|
1089
|
+
displayLine = Int32.MinValue;
|
1090
|
+
let lastParkedCtrl = LastFocusedManager.getLastFocusedControl();
|
1091
|
+
if (lastParkedCtrl !== null && lastParkedCtrl.getForm().getTask().getMGData().GetId() === ctrl.getForm().getTask().getMGData().GetId() && lastParkedCtrl.getForm().getTask().getLevel() === Constants.TASK_LEVEL_CONTROL) {
|
1092
|
+
if ((ctrl !== lastParkedCtrl || (ctrl.isRepeatable() && displayLine !== ctrl.getDisplayLine(true))) && !lastParkedCtrl.isInControlSuffix()) {
|
1093
|
+
await this.handleInternalEventWithMgControlBase(lastParkedCtrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
|
1094
|
+
if (this._stopExecution) {
|
1095
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_LIST || ctrl.Type === MgControlType.CTRL_TYPE_RADIO || ctrl.Type === MgControlType.CTRL_TYPE_CHECKBOX || ctrl.isTabControl()) {
|
1096
|
+
ctrl.resetPrevVal();
|
1097
|
+
await ctrl.RefreshDisplay();
|
1098
|
+
}
|
1099
|
+
return false;
|
1100
|
+
}
|
1101
|
+
}
|
1102
|
+
else
|
1103
|
+
return false;
|
1104
|
+
}
|
1105
|
+
if (task.InCtrlPrefix)
|
1106
|
+
return false;
|
1107
|
+
task.InCtrlPrefix = true;
|
1108
|
+
let prevCtrl = lastParkedCtrl;
|
1109
|
+
if (currClickedCtrl !== null && currClickedCtrl.getForm().getTask().getMgdID() === ctrl.getForm().getTask().getMgdID() && ctrl.onDiffForm(currClickedCtrl))
|
1110
|
+
prevCtrl = currClickedCtrl;
|
1111
|
+
if (prevCtrl !== null && ctrl.onDiffForm(prevCtrl)) {
|
1112
|
+
let prevTask = prevCtrl.getForm().getTask();
|
1113
|
+
await prevTask.execSubformRecSuffix(ctrl.getForm().getTask());
|
1114
|
+
if (this._stopExecution) {
|
1115
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_LIST || ctrl.Type === MgControlType.CTRL_TYPE_RADIO || ctrl.Type === MgControlType.CTRL_TYPE_CHECKBOX || ctrl.isTabControl()) {
|
1116
|
+
ctrl.resetPrevVal();
|
1117
|
+
await ctrl.RefreshDisplay();
|
1118
|
+
}
|
1119
|
+
task.InCtrlPrefix = false;
|
1120
|
+
return false;
|
1121
|
+
}
|
1122
|
+
if (ctrl.getForm().getTask().isAborting()) {
|
1123
|
+
task.InCtrlPrefix = false;
|
1124
|
+
return false;
|
1125
|
+
}
|
1126
|
+
await EventsManager.doSyncForSubformParent(task);
|
1127
|
+
}
|
1128
|
+
if (task.DataView.isEmptyDataview())
|
1129
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1130
|
+
else {
|
1131
|
+
task.SubformExecMode = Task_SubformExecModeEnum.SET_FOCUS;
|
1132
|
+
let rtEvt = new RunTimeEvent(ctrl, displayLine);
|
1133
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_REC_PREFIX);
|
1134
|
+
await this.handleEvent(rtEvt, false);
|
1135
|
+
}
|
1136
|
+
if (this.GetStopExecutionFlag()) {
|
1137
|
+
task.InCtrlPrefix = false;
|
1138
|
+
return false;
|
1139
|
+
}
|
1140
|
+
if (!await ctrl.IsParkable() && ctrl !== lastParkedCtrl) {
|
1141
|
+
task.InCtrlPrefix = false;
|
1142
|
+
if (lastParkedCtrl === null || !await lastParkedCtrl.invoke())
|
1143
|
+
await this.HandleNonParkableControls(ctrl.getForm().getTask());
|
1144
|
+
return false;
|
1145
|
+
}
|
1146
|
+
Logger.Instance.WriteSupportToLog(NString.Format('{0} Entering control: control {1}, row {2}', task.GetTaskDetails(), ctrl.Name, displayLine < 0 ? 0 : displayLine), true);
|
1147
|
+
task.setLevel(Constants.TASK_LEVEL_CONTROL);
|
1148
|
+
ctrl.KeyStrokeOn = false;
|
1149
|
+
ctrl.ModifiedByUser = false;
|
1150
|
+
task.setCurrField(ctrl.getField());
|
1151
|
+
if (ctrl.IsRepeatable)
|
1152
|
+
await form.bringRecordToPage();
|
1153
|
+
if (lastParkedCtrl !== ctrl) {
|
1154
|
+
if ((lastParkedCtrl === null && ctrl.getForm().isSubForm()) || (lastParkedCtrl !== null && (ctrl.getForm().isSubForm() || lastParkedCtrl.getForm().isSubForm()))) {
|
1155
|
+
let lastParkedTask = null;
|
1156
|
+
if (lastParkedCtrl !== null)
|
1157
|
+
lastParkedTask = lastParkedCtrl.getForm().getTask();
|
1158
|
+
if (lastParkedTask !== task) {
|
1159
|
+
let firstTime = true;
|
1160
|
+
let isSonSubform;
|
1161
|
+
let parentTask;
|
1162
|
+
if (lastParkedTask !== null) {
|
1163
|
+
isSonSubform = lastParkedTask.IsSubForm;
|
1164
|
+
for (parentTask = lastParkedTask; parentTask !== null && isSonSubform; parentTask = parentTask.getParent()) {
|
1165
|
+
if (!firstTime) {
|
1166
|
+
isSonSubform = parentTask.IsSubForm;
|
1167
|
+
parentTask.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, false);
|
1168
|
+
parentTask.ActionManager.enable(InternalInterface.MG_ACT_DELLINE, false);
|
1169
|
+
parentTask.enableCreateActs(false);
|
1170
|
+
}
|
1171
|
+
else
|
1172
|
+
firstTime = false;
|
1173
|
+
}
|
1174
|
+
}
|
1175
|
+
isSonSubform = task.IsSubForm;
|
1176
|
+
for (parentTask = task.getParent(); (parentTask !== null) && isSonSubform; parentTask = parentTask.getParent()) {
|
1177
|
+
isSonSubform = parentTask.IsSubForm;
|
1178
|
+
if (parentTask.getEnableZoomHandler())
|
1179
|
+
parentTask.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, true);
|
1180
|
+
await parentTask.setCreateDeleteActsEnableState();
|
1181
|
+
}
|
1182
|
+
await task.enableModes();
|
1183
|
+
}
|
1184
|
+
}
|
1185
|
+
}
|
1186
|
+
if (task.getEnableZoomHandler() || ctrl.useZoomHandler())
|
1187
|
+
task.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, true);
|
1188
|
+
if (ctrl.isTextControl() || ctrl.isChoiceControl())
|
1189
|
+
ctrl.SetKeyboardLanguage();
|
1190
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_BUTTON)
|
1191
|
+
task.ActionManager.enable(InternalInterface.MG_ACT_BUTTON, true);
|
1192
|
+
await task.setCreateDeleteActsEnableState();
|
1193
|
+
let field = ctrl.getField();
|
1194
|
+
if (field !== null && field.NullAllowed && ctrl.isModifiable() && ctrl.Type !== MgControlType.CTRL_TYPE_BUTTON)
|
1195
|
+
task.ActionManager.enable(InternalInterface.MG_ACT_RT_EDT_NULL, true);
|
1196
|
+
return true;
|
1197
|
+
}
|
1198
|
+
async commonHandlerBefore(evt) {
|
1199
|
+
let evtSave = evt;
|
1200
|
+
let task = evt.getTask();
|
1201
|
+
let rec = null;
|
1202
|
+
let prevRec = null;
|
1203
|
+
let val;
|
1204
|
+
let oldDisplayLine = Int32.MinValue;
|
1205
|
+
if (this._stopExecution)
|
1206
|
+
return false;
|
1207
|
+
if (task.isAborting())
|
1208
|
+
return false;
|
1209
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_SYSTEM) {
|
1210
|
+
let actId = this.getMatchingAction(evt.getKbdItm());
|
1211
|
+
if (actId !== 0 && evt.Control !== null) {
|
1212
|
+
evt = new RunTimeEvent(evt, evt);
|
1213
|
+
evt.setInternal(actId);
|
1214
|
+
evt.setArgList(null);
|
1215
|
+
let mgControl = evt.Control;
|
1216
|
+
evtSave.setCtrl(mgControl);
|
1217
|
+
if (mgControl === null)
|
1218
|
+
return false;
|
1219
|
+
}
|
1220
|
+
}
|
1221
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
|
1222
|
+
let form = task.getForm();
|
1223
|
+
let displayLine = evt.getDisplayLine();
|
1224
|
+
let dv = task.DataView;
|
1225
|
+
rec = dv.getCurrRec();
|
1226
|
+
let ctrl = evt.Control;
|
1227
|
+
let intEvtCode = evt.getInternalCode();
|
1228
|
+
let lastFocusedCtrl = LastFocusedManager.getLastFocusedControl();
|
1229
|
+
switch (intEvtCode) {
|
1230
|
+
case InternalInterface.MG_ACT_ZOOM:
|
1231
|
+
let boolval = await this.selectProg(ctrl);
|
1232
|
+
if (boolval)
|
1233
|
+
return false;
|
1234
|
+
case InternalInterface.MG_ACT_WEB_ON_DBLICK:
|
1235
|
+
break;
|
1236
|
+
case InternalInterface.MG_ACT_CTRL_FOCUS:
|
1237
|
+
await this.handleFocus(ctrl, displayLine, evt.isProduceClick(), evt.ShouldHandleZoom);
|
1238
|
+
return false;
|
1239
|
+
case InternalInterface.MG_ACT_CTRL_FOCUS_ON_NON_MAGIC_CONTROL:
|
1240
|
+
await this.handleFocusOnNonMagicControl(ctrl);
|
1241
|
+
return false;
|
1242
|
+
case InternalInterface.MG_ACT_CTRL_KEYDOWN:
|
1243
|
+
await this.handleKeyDown(task, ctrl, evt);
|
1244
|
+
return false;
|
1245
|
+
case InternalInterface.MG_ACT_CTRL_MOUSEUP:
|
1246
|
+
await this.handleMouseUp(ctrl, displayLine, evt.isProduceClick());
|
1247
|
+
return false;
|
1248
|
+
case InternalInterface.MG_ACT_SELECTION:
|
1249
|
+
await this.onActSelection(ctrl, form, evt);
|
1250
|
+
return false;
|
1251
|
+
case InternalInterface.MG_ACT_TIMER:
|
1252
|
+
await this.handleTimer(evt);
|
1253
|
+
return false;
|
1254
|
+
case InternalInterface.MG_ACT_RESIZE:
|
1255
|
+
this.handleResize(ctrl, displayLine);
|
1256
|
+
return false;
|
1257
|
+
case InternalInterface.MG_ACT_ROW_DATA_CURR_PAGE:
|
1258
|
+
await this.handleRowDataCurPage(ctrl, displayLine, evt.isSendAll(), evt.LastFocusedVal);
|
1259
|
+
return false;
|
1260
|
+
case InternalInterface.MG_ACT_DV_TO_GUI:
|
1261
|
+
await this.handleTransferDataToGui(ctrl);
|
1262
|
+
return false;
|
1263
|
+
case InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER:
|
1264
|
+
await this.fetchRecordsAheadFromServer(ctrl);
|
1265
|
+
break;
|
1266
|
+
case InternalInterface.MG_ACT_ENABLE_EVENTS:
|
1267
|
+
this.handleEnableEvents(evt, true);
|
1268
|
+
return false;
|
1269
|
+
case InternalInterface.MG_ACT_DISABLE_EVENTS:
|
1270
|
+
this.handleEnableEvents(evt, false);
|
1271
|
+
return false;
|
1272
|
+
case InternalInterface.MG_ACT_TASK_PREFIX:
|
1273
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
1274
|
+
break;
|
1275
|
+
case InternalInterface.MG_ACT_TASK_SUFFIX:
|
1276
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
1277
|
+
break;
|
1278
|
+
case InternalInterface.MG_ACT_REC_PREFIX:
|
1279
|
+
if (task.IsSubForm && task.getParent().InCommonHandlerBeforeRP)
|
1280
|
+
return false;
|
1281
|
+
task.setAfterRetry(ConstInterface.RECOVERY_NONE);
|
1282
|
+
task.DataSynced = false;
|
1283
|
+
if (!task.isStarted())
|
1284
|
+
return false;
|
1285
|
+
if (form.getRowsInPage() > Int32.MinValue && displayLine > Int32.MinValue) {
|
1286
|
+
while (!dv.recExists(displayLine) && displayLine > 0) {
|
1287
|
+
displayLine--;
|
1288
|
+
}
|
1289
|
+
if (displayLine >= 0) {
|
1290
|
+
prevRec = dv.getCurrRec();
|
1291
|
+
let oldTaskMode = task.getMode();
|
1292
|
+
let oldRecId = prevRec.getId();
|
1293
|
+
try {
|
1294
|
+
oldDisplayLine = form.DisplayLine;
|
1295
|
+
form.PrevDisplayLine = oldDisplayLine;
|
1296
|
+
await form.setCurrRowByDisplayLine(displayLine, true, false);
|
1297
|
+
if (prevRec != null && !dv.recExistsById(prevRec.getId())) {
|
1298
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_TABLE);
|
1299
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
1300
|
+
}
|
1301
|
+
rec = dv.getCurrRec();
|
1302
|
+
}
|
1303
|
+
catch (e) {
|
1304
|
+
if (e instanceof RecordOutOfDataViewException) {
|
1305
|
+
if (this._stopExecution) {
|
1306
|
+
if (oldTaskMode === Constants.TASK_MODE_CREATE && oldDisplayLine > 0 &&
|
1307
|
+
!dv.recExistsById(oldRecId)) {
|
1308
|
+
let prevLine = form.getPrevLine(oldDisplayLine);
|
1309
|
+
await form.restoreOldDisplayLine(prevLine);
|
1310
|
+
}
|
1311
|
+
else
|
1312
|
+
await form.restoreOldDisplayLine(oldDisplayLine);
|
1313
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
1314
|
+
this.setStopExecution(false);
|
1315
|
+
lastFocusedCtrl = task.getLastParkedCtrl();
|
1316
|
+
task.getLastParkedCtrl();
|
1317
|
+
if (lastFocusedCtrl != null)
|
1318
|
+
await lastFocusedCtrl.invoke();
|
1319
|
+
this.setStopExecution(true);
|
1320
|
+
return false;
|
1321
|
+
}
|
1322
|
+
else
|
1323
|
+
Logger.Instance.WriteDevToLog(e.StackTrace);
|
1324
|
+
}
|
1325
|
+
else
|
1326
|
+
throw e;
|
1327
|
+
}
|
1328
|
+
}
|
1329
|
+
else
|
1330
|
+
throw new ApplicationException('in EventsManager.commonHandlerBefore(): invalid line number: ' +
|
1331
|
+
displayLine);
|
1332
|
+
}
|
1333
|
+
if (rec == null)
|
1334
|
+
throw new ApplicationException('in EventsManager.commonHandlerBefore(): no current record available !');
|
1335
|
+
if (!task.IsInteractive && task.getLevel() === Constants.TASK_LEVEL_TASK)
|
1336
|
+
task.increaseCounter();
|
1337
|
+
if (await task.evalEndCond(ConstInterface.END_COND_EVAL_BEFORE)) {
|
1338
|
+
await task.endTask(true, false, false);
|
1339
|
+
return false;
|
1340
|
+
}
|
1341
|
+
if (form.HasTable())
|
1342
|
+
await form.bringRecordToPage();
|
1343
|
+
if (task.getLevel() !== Constants.TASK_LEVEL_TASK)
|
1344
|
+
return false;
|
1345
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
1346
|
+
Logger.Instance.WriteDevToLog('RECORD PREFIX: ' + task.queryTaskPath());
|
1347
|
+
(dv.getCurrRec()).setForceSaveOrg(false);
|
1348
|
+
(dv.getCurrRec()).Synced = false;
|
1349
|
+
dv.saveOriginal();
|
1350
|
+
if (task.IsSubForm && task.PerformParentRecordPrefix) {
|
1351
|
+
let parentTask = task.getParent();
|
1352
|
+
while (parentTask.IsSubForm) {
|
1353
|
+
if (parentTask.getLevel() === Constants.TASK_LEVEL_TASK) {
|
1354
|
+
await this.handleInternalEventWithTask(parentTask, InternalInterface.MG_ACT_REC_PREFIX);
|
1355
|
+
parentTask = parentTask.getParent();
|
1356
|
+
if (this.GetStopExecutionFlag())
|
1357
|
+
break;
|
1358
|
+
}
|
1359
|
+
else
|
1360
|
+
break;
|
1361
|
+
}
|
1362
|
+
}
|
1363
|
+
task.InCommonHandlerBeforeRP = true;
|
1364
|
+
if (await task.CheckRefreshSubTasks())
|
1365
|
+
await dv.computeSubForms();
|
1366
|
+
task.InCommonHandlerBeforeRP = false;
|
1367
|
+
task.setLevel(Constants.TASK_LEVEL_RECORD);
|
1368
|
+
await task.enableRecordActions();
|
1369
|
+
break;
|
1370
|
+
case InternalInterface.MG_ACT_REC_SUFFIX:
|
1371
|
+
let forceSuffix = false;
|
1372
|
+
let isSelectionTable;
|
1373
|
+
task.ConfirmUpdateNo = false;
|
1374
|
+
if (rec == null)
|
1375
|
+
return false;
|
1376
|
+
forceSuffix = await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
|
1377
|
+
if ((rec.Modified || forceSuffix) && rec.getMode() === DataModificationTypes.Delete &&
|
1378
|
+
task.getMode() === Constants.TASK_MODE_DELETE)
|
1379
|
+
return true;
|
1380
|
+
if (task.getLevel() === Constants.TASK_LEVEL_TASK)
|
1381
|
+
return false;
|
1382
|
+
if (task.getLevel() === Constants.TASK_LEVEL_CONTROL) {
|
1383
|
+
task.setInRecordSuffix(true);
|
1384
|
+
await this.handleInternalEventWithMgControlBase(task.getLastParkedCtrl(), InternalInterface.MG_ACT_CTRL_SUFFIX);
|
1385
|
+
task.setInRecordSuffix(false);
|
1386
|
+
if (this._stopExecution)
|
1387
|
+
return false;
|
1388
|
+
}
|
1389
|
+
await task.handleEventOnSlaveTasks(InternalInterface.MG_ACT_REC_SUFFIX);
|
1390
|
+
if (this._stopExecution)
|
1391
|
+
return false;
|
1392
|
+
Logger.Instance.WriteDevToLog('RECORD SUFFIX: ' + task.queryTaskPath());
|
1393
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
1394
|
+
isSelectionTable = await task.checkProp(PropInterface.PROP_TYPE_SELECTION, false);
|
1395
|
+
if (task.getMode() === Constants.TASK_MODE_QUERY && !forceSuffix && !rec.Modified &&
|
1396
|
+
!isSelectionTable)
|
1397
|
+
return false;
|
1398
|
+
if (!rec.Modified && !forceSuffix && (!isSelectionTable || !task.InSelect)) {
|
1399
|
+
if (rec.getMode() === DataModificationTypes.Delete) {
|
1400
|
+
return await this.executeControlVerification(task);
|
1401
|
+
}
|
1402
|
+
return false;
|
1403
|
+
}
|
1404
|
+
if (task.getMode() !== Constants.TASK_MODE_DELETE && rec.Modified) {
|
1405
|
+
if (!await this.updateConfirmed(task))
|
1406
|
+
return false;
|
1407
|
+
}
|
1408
|
+
let stopExecution = !await this.executeControlVerification(task);
|
1409
|
+
if (stopExecution)
|
1410
|
+
return false;
|
1411
|
+
break;
|
1412
|
+
case InternalInterface.MG_ACT_CTRL_PREFIX:
|
1413
|
+
if (await this.handleCtrlPrefix(evt))
|
1414
|
+
return true;
|
1415
|
+
else {
|
1416
|
+
evt.Control.InControl = false;
|
1417
|
+
return false;
|
1418
|
+
}
|
1419
|
+
case InternalInterface.MG_ACT_CANCEL:
|
1420
|
+
Manager.CleanMessagePane(task);
|
1421
|
+
break;
|
1422
|
+
case InternalInterface.MG_ACT_CTRL_SUFFIX:
|
1423
|
+
if (ctrl == null || this.getStopExecutionCtrl() != null)
|
1424
|
+
return false;
|
1425
|
+
if (task.getLevel() !== Constants.TASK_LEVEL_CONTROL)
|
1426
|
+
return false;
|
1427
|
+
if (!ctrl.isSubform()) {
|
1428
|
+
val = Manager.GetCtrlVal(ctrl);
|
1429
|
+
task.CurrentEditingControl = null;
|
1430
|
+
if (!task.cancelWasRaised() &&
|
1431
|
+
(ctrl.Type !== MgControlType.CTRL_TYPE_BROWSER && (!isNullOrUndefined(ctrl._field) && (ctrl._field.getType() === StorageAttribute.DATE || ctrl._field.getType() == StorageAttribute.NUMERIC) || val !== null) && typeof val != 'undefined' &&
|
1432
|
+
!await ctrl.validateAndSetValue(val, true))) {
|
1433
|
+
this.setStopExecution(true);
|
1434
|
+
return false;
|
1435
|
+
}
|
1436
|
+
}
|
1437
|
+
if (!this._stopExecution)
|
1438
|
+
Manager.CleanMessagePane(task);
|
1439
|
+
ctrl.InControl = false;
|
1440
|
+
ctrl.ClipBoardDataExists = false;
|
1441
|
+
ctrl.ValidateControl = true;
|
1442
|
+
ctrl.setInControlSuffix(true);
|
1443
|
+
break;
|
1444
|
+
}
|
1445
|
+
}
|
1446
|
+
return true;
|
1447
|
+
}
|
1448
|
+
async selectProg(ctrl) {
|
1449
|
+
let cmd;
|
1450
|
+
let value;
|
1451
|
+
let mgVal;
|
1452
|
+
let progExecuted = false;
|
1453
|
+
let task = ctrl.getForm().getTask();
|
1454
|
+
if (ctrl.HasSelectProgram()) {
|
1455
|
+
if (ctrl.IsParkable()) {
|
1456
|
+
value = Manager.GetCtrlVal(ctrl);
|
1457
|
+
if (!ctrl.validateAndSetValue(value, false))
|
1458
|
+
this.setStopExecution(true);
|
1459
|
+
else {
|
1460
|
+
let encodedVal = null;
|
1461
|
+
mgVal = await ctrl.getMgValue(value);
|
1462
|
+
var rec = task.DataView.getCurrRec();
|
1463
|
+
encodedVal = rec.getXMLForValue(ctrl.getField().getId(), mgVal);
|
1464
|
+
cmd = CommandFactory.CreateSelectProgramCommand(task.getTaskTag(), null, Int32.MinValue, ctrl.getDitIdx(), encodedVal);
|
1465
|
+
task.getMGData().CmdsToServer.Add(cmd);
|
1466
|
+
let commandsProcessorServer = CommandsProcessorManager.GetCommandsProcessor();
|
1467
|
+
await commandsProcessorServer.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
1468
|
+
progExecuted = true;
|
1469
|
+
}
|
1470
|
+
}
|
1471
|
+
}
|
1472
|
+
return progExecuted;
|
1473
|
+
}
|
1474
|
+
async executeControlVerification(task) {
|
1475
|
+
let table = task.getHandlersTab();
|
1476
|
+
for (let i = 0; i < table.getSize(); i++) {
|
1477
|
+
let handler = table.getHandler(i);
|
1478
|
+
let evt = handler.getEvent();
|
1479
|
+
if (evt.getInternalCode() === InternalInterface.MG_ACT_CTRL_VERIFICATION) {
|
1480
|
+
let control = ((task.getForm() !== null) ? task.getForm().getCtrlByCtrlName(handler.getCtrlName()) : null);
|
1481
|
+
if (!isNullOrUndefined(control)) {
|
1482
|
+
let runTimeEvent = new RunTimeEvent(control);
|
1483
|
+
runTimeEvent.setInternal(InternalInterface.MG_ACT_CTRL_VERIFICATION);
|
1484
|
+
await this.handleEvent(runTimeEvent, false);
|
1485
|
+
if (this._stopExecution) {
|
1486
|
+
LastFocusedManager.setLastFocusedControl(task, control);
|
1487
|
+
this.setStopExecutionCtrl(null);
|
1488
|
+
this.setStopExecutionCtrl(control);
|
1489
|
+
return false;
|
1490
|
+
}
|
1491
|
+
}
|
1492
|
+
}
|
1493
|
+
}
|
1494
|
+
return true;
|
1495
|
+
}
|
1496
|
+
async onActSelection(ctrl, form, evt) {
|
1497
|
+
let displayLine = evt.getDisplayLine();
|
1498
|
+
if (displayLine === Int32.MinValue)
|
1499
|
+
displayLine = form.DisplayLine;
|
1500
|
+
let simulate = ctrl.Type === MgControlType.CTRL_TYPE_CHECKBOX || ctrl.Type === MgControlType.CTRL_TYPE_LIST || ctrl.Type === MgControlType.CTRL_TYPE_RADIO || ctrl.Type === MgControlType.CTRL_TYPE_BUTTON || (ctrl.Type === MgControlType.CTRL_TYPE_TAB && !evt.isProduceClick());
|
1501
|
+
if (simulate)
|
1502
|
+
await this.simulateSelection(ctrl, evt.getValue(), displayLine, evt.isProduceClick());
|
1503
|
+
else
|
1504
|
+
await this.handleSelection(ctrl, displayLine, evt.getValue());
|
1505
|
+
}
|
1506
|
+
async onSubformClose(task, evt) {
|
1507
|
+
if ((evt.getArgList() != null) && (evt.getArgList().getSize() === 1)) {
|
1508
|
+
let subformCtrl = null;
|
1509
|
+
let closingSubformName = await evt.getArgList().getArgValue(0, StorageAttribute.ALPHA, 0);
|
1510
|
+
if (closingSubformName == null)
|
1511
|
+
return;
|
1512
|
+
for (let parentTask = task; parentTask.getForm() != null && parentTask.getMgdID() === task.getMgdID(); parentTask = parentTask.getParent()) {
|
1513
|
+
subformCtrl = parentTask.getForm().getCtrlByName(closingSubformName.trim(), MgControlType.CTRL_TYPE_SUBFORM);
|
1514
|
+
if (subformCtrl != null) {
|
1515
|
+
let subformTask = subformCtrl.getSubformTask();
|
1516
|
+
if (subformTask != null && !subformTask.IsRoute()) {
|
1517
|
+
{
|
1518
|
+
await this.performSubformClose(subformCtrl);
|
1519
|
+
}
|
1520
|
+
break;
|
1521
|
+
}
|
1522
|
+
}
|
1523
|
+
}
|
1524
|
+
}
|
1525
|
+
}
|
1526
|
+
async performSubformClose(subformCtrl) {
|
1527
|
+
let subformTask = subformCtrl.getSubformTask();
|
1528
|
+
let parentTask = subformCtrl.getForm().getTask();
|
1529
|
+
let mgd = subformTask.getMGData();
|
1530
|
+
this.pushNewExecStacks();
|
1531
|
+
await subformTask.endTask(true, false, false, true);
|
1532
|
+
this.popNewExecStacks();
|
1533
|
+
if (!this._stopExecution) {
|
1534
|
+
parentTask.TaskService.RemoveRecomputes(parentTask);
|
1535
|
+
await subformTask.stop();
|
1536
|
+
subformCtrl.resetSubformTask();
|
1537
|
+
await CommandsProcessorManager.GetCommandsProcessor().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
1538
|
+
Commands.addClosesubform(CommandType.CLOSE_SUB_FORM, subformCtrl, subformTask.getTaskTag(), subformCtrl.getName(), subformTask.getForm().buildFormName());
|
1539
|
+
if (subformCtrl.IsModal())
|
1540
|
+
mgd.abort();
|
1541
|
+
}
|
1542
|
+
}
|
1543
|
+
createEventArguments(evt) {
|
1544
|
+
if (evt.getArgList() === null) {
|
1545
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
|
1546
|
+
switch (evt.getInternalCode()) {
|
1547
|
+
default:
|
1548
|
+
break;
|
1549
|
+
}
|
1550
|
+
}
|
1551
|
+
}
|
1552
|
+
}
|
1553
|
+
async DoTaskLevelRecordSuffix(task, refDoSuffix) {
|
1554
|
+
let shouldReturn = false;
|
1555
|
+
if (task.getLevel() === Constants.TASK_LEVEL_RECORD) {
|
1556
|
+
refDoSuffix.value = false;
|
1557
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1558
|
+
if (this.GetStopExecutionFlag())
|
1559
|
+
shouldReturn = true;
|
1560
|
+
}
|
1561
|
+
return shouldReturn;
|
1562
|
+
}
|
1563
|
+
async DoTaskLevelRecordPrefix(task) {
|
1564
|
+
if (!this.GetStopExecutionFlag()) {
|
1565
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1566
|
+
}
|
1567
|
+
}
|
1568
|
+
async commonHandler(evt) {
|
1569
|
+
let task = evt.getTask();
|
1570
|
+
let mgData = task.getMGData();
|
1571
|
+
let form = task.getForm();
|
1572
|
+
let ctrl = evt.Control;
|
1573
|
+
let lastParkedCtrl;
|
1574
|
+
let doSuffix = true;
|
1575
|
+
let oldMode;
|
1576
|
+
let server = Task.CommandsProcessor;
|
1577
|
+
if (this._stopExecution)
|
1578
|
+
return;
|
1579
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_USER)
|
1580
|
+
evt = new RunTimeEvent(evt.getUserEvent(), evt);
|
1581
|
+
try {
|
1582
|
+
this.pushRtEvent(evt);
|
1583
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_SYSTEM) {
|
1584
|
+
let actId = this.getMatchingAction(evt.getKbdItm());
|
1585
|
+
if (actId !== 0) {
|
1586
|
+
evt = new RunTimeEvent(evt, evt);
|
1587
|
+
evt.setInternal(actId);
|
1588
|
+
evt.setArgList(null);
|
1589
|
+
}
|
1590
|
+
}
|
1591
|
+
let cmd;
|
1592
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && !evt.isImmediate() && this.ActAllowed(evt.getInternalCode()) && !this._processingTopMostEndTask) {
|
1593
|
+
let cmdsToServer = mgData.CmdsToServer;
|
1594
|
+
let dv = task.DataView;
|
1595
|
+
let rec = dv.getCurrRec();
|
1596
|
+
let intEvtCode = evt.getInternalCode();
|
1597
|
+
switch (intEvtCode) {
|
1598
|
+
case InternalInterface.MG_ACT_SUBFORM_CLOSE:
|
1599
|
+
await this.onSubformClose(task, evt);
|
1600
|
+
break;
|
1601
|
+
case InternalInterface.MG_ACT_BUTTON:
|
1602
|
+
case InternalInterface.MG_ACT_CTRL_HIT:
|
1603
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_BUTTON &&
|
1604
|
+
(intEvtCode === InternalInterface.MG_ACT_BUTTON || !evt.isGuiTriggeredEvent() || ctrl.isParkable(true))) {
|
1605
|
+
let aRtEvt = new RunTimeEvent(ctrl);
|
1606
|
+
if (ctrl.getRtEvtTask() != null)
|
1607
|
+
aRtEvt.setTask(ctrl.getRtEvtTask());
|
1608
|
+
if (ConstInterface.EVENT_TYPE_NONE !== aRtEvt.getType()) {
|
1609
|
+
if (ctrl.useZoomHandler()) {
|
1610
|
+
let taskToEnable = aRtEvt.getTask();
|
1611
|
+
if (taskToEnable != null)
|
1612
|
+
taskToEnable.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, true);
|
1613
|
+
}
|
1614
|
+
aRtEvt.setArgList(ctrl.ArgList);
|
1615
|
+
await aRtEvt.setPublicName();
|
1616
|
+
this.addToTail(aRtEvt);
|
1617
|
+
this.checkAndSaveRouteEventIfCtxRemovedFromSrvr(aRtEvt);
|
1618
|
+
}
|
1619
|
+
}
|
1620
|
+
else if (ctrl.Type === MgControlType.CTRL_TYPE_TAB) {
|
1621
|
+
this.addInternalEventWithCtrlAndCode(ctrl, InternalInterface.MG_ACT_ZOOM);
|
1622
|
+
}
|
1623
|
+
else if (ctrl.Type === MgControlType.CTRL_TYPE_RADIO) {
|
1624
|
+
ctrl.setControlToFocus();
|
1625
|
+
}
|
1626
|
+
break;
|
1627
|
+
case InternalInterface.MG_ACT_TOGGLE_INSERT:
|
1628
|
+
RuntimeContextBase.Instance.ToggleInsertMode();
|
1629
|
+
break;
|
1630
|
+
case InternalInterface.MG_ACT_CLOSE:
|
1631
|
+
let rtEvt = new RunTimeEvent(evt, evt);
|
1632
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_EXIT);
|
1633
|
+
this.addToTail(rtEvt);
|
1634
|
+
break;
|
1635
|
+
case InternalInterface.MG_ACT_EXIT:
|
1636
|
+
let taskToEnd = (task.isMainProg() ? MGDataCollection.Instance.StartupMgData.getFirstTask() : task);
|
1637
|
+
await taskToEnd.endTask(evt.reversibleExit(), false, evt.ExitDueToError());
|
1638
|
+
break;
|
1639
|
+
case InternalInterface.MG_ACT_EXIT_SYSTEM:
|
1640
|
+
await MGDataCollection.Instance.StartupMgData.getFirstTask().endTask(evt.reversibleExit(), false, false);
|
1641
|
+
break;
|
1642
|
+
case InternalInterface.MG_ACT_TBL_NXTLINE:
|
1643
|
+
if (form != null)
|
1644
|
+
await form.moveInView(Constants.MOVE_UNIT_ROW, Constants.MOVE_DIRECTION_NEXT);
|
1645
|
+
break;
|
1646
|
+
case InternalInterface.MG_ACT_TBL_PRVLINE:
|
1647
|
+
if (form != null)
|
1648
|
+
await form.moveInView(Constants.MOVE_UNIT_ROW, Constants.MOVE_DIRECTION_PREV);
|
1649
|
+
break;
|
1650
|
+
case InternalInterface.MG_ACT_TBL_NXTPAGE:
|
1651
|
+
if (form != null)
|
1652
|
+
await form.moveInView(Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_NEXT);
|
1653
|
+
break;
|
1654
|
+
case InternalInterface.MG_ACT_TBL_PRVPAGE:
|
1655
|
+
if (form != null)
|
1656
|
+
await form.moveInView(Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_PREV);
|
1657
|
+
break;
|
1658
|
+
case InternalInterface.MG_ACT_TBL_BEGPAGE:
|
1659
|
+
if (form != null)
|
1660
|
+
await form.moveInView(Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_BEGIN);
|
1661
|
+
break;
|
1662
|
+
case InternalInterface.MG_ACT_TBL_ENDPAGE:
|
1663
|
+
if (form != null)
|
1664
|
+
await form.moveInView(Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_END);
|
1665
|
+
break;
|
1666
|
+
case InternalInterface.MG_ACT_TBL_BEGTBL:
|
1667
|
+
lastParkedCtrl = task.getLastParkedCtrl();
|
1668
|
+
if (lastParkedCtrl == null || !lastParkedCtrl.isListBox()) {
|
1669
|
+
if (form != null)
|
1670
|
+
await form.moveInView(Constants.MOVE_UNIT_TABLE, Constants.MOVE_DIRECTION_BEGIN);
|
1671
|
+
}
|
1672
|
+
break;
|
1673
|
+
case InternalInterface.MG_ACT_TBL_ENDTBL:
|
1674
|
+
lastParkedCtrl = task.getLastParkedCtrl();
|
1675
|
+
if (lastParkedCtrl === null || !lastParkedCtrl.isListBox()) {
|
1676
|
+
if (form != null)
|
1677
|
+
await form.moveInView(Constants.MOVE_UNIT_TABLE, Constants.MOVE_DIRECTION_END);
|
1678
|
+
}
|
1679
|
+
break;
|
1680
|
+
case InternalInterface.MG_ACT_WEB_ON_DBLICK:
|
1681
|
+
{
|
1682
|
+
let ctrlType = ctrl.Type;
|
1683
|
+
let putAction = InternalInterface.MG_ACT_NONE;
|
1684
|
+
if (ctrlType !== MgControlType.CTRL_TYPE_TABLE && ctrlType !== MgControlType.CTRL_TYPE_LABEL &&
|
1685
|
+
ctrlType !== MgControlType.CTRL_TYPE_IMAGE) {
|
1686
|
+
if (ctrl.getForm().getTask().ActionManager.isEnabled(InternalInterface.MG_ACT_SELECT))
|
1687
|
+
putAction = InternalInterface.MG_ACT_SELECT;
|
1688
|
+
else {
|
1689
|
+
if (ctrl.getForm().getTask().ActionManager.isEnabled(InternalInterface.MG_ACT_ZOOM))
|
1690
|
+
putAction = InternalInterface.MG_ACT_ZOOM;
|
1691
|
+
}
|
1692
|
+
if (putAction !== InternalInterface.MG_ACT_NONE)
|
1693
|
+
this.addInternalEventWithCtrlAndCode(ctrl, putAction);
|
1694
|
+
}
|
1695
|
+
}
|
1696
|
+
break;
|
1697
|
+
case InternalInterface.MG_ACT_DELLINE:
|
1698
|
+
if (await this.HandleActionDelline(task, dv, rec, false))
|
1699
|
+
return;
|
1700
|
+
break;
|
1701
|
+
case InternalInterface.MG_ACT_CRELINE:
|
1702
|
+
case InternalInterface.MG_ACT_CRELINE_ABOVE:
|
1703
|
+
if (task.DataView.isEmptyDataview()) {
|
1704
|
+
await this.gotoCreateMode(task);
|
1705
|
+
break;
|
1706
|
+
}
|
1707
|
+
if (task.getInCreateLine())
|
1708
|
+
break;
|
1709
|
+
task.setInCreateLine(true);
|
1710
|
+
try {
|
1711
|
+
if (task.getLevel() === Constants.TASK_LEVEL_CONTROL) {
|
1712
|
+
await this.handleInternalEventWithMgControlBase(task.getLastParkedCtrl(), InternalInterface.MG_ACT_CTRL_SUFFIX);
|
1713
|
+
if (this.GetStopExecutionFlag())
|
1714
|
+
return;
|
1715
|
+
}
|
1716
|
+
if (task.getMode() === Constants.TASK_MODE_CREATE && rec != null && !rec.Modified) {
|
1717
|
+
if (await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false)) {
|
1718
|
+
doSuffix = false;
|
1719
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1720
|
+
if (this.GetStopExecutionFlag() || task.isAborting())
|
1721
|
+
return;
|
1722
|
+
}
|
1723
|
+
else {
|
1724
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
1725
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1726
|
+
if (!this.GetStopExecutionFlag() && form != null) {
|
1727
|
+
let lastParkedControl = task.getLastParkedCtrl();
|
1728
|
+
if (lastParkedControl !== null)
|
1729
|
+
await lastParkedControl.invoke();
|
1730
|
+
}
|
1731
|
+
return;
|
1732
|
+
}
|
1733
|
+
}
|
1734
|
+
let refDoSuffix = new RefParam(doSuffix);
|
1735
|
+
if (await this.DoTaskLevelRecordSuffix(task, refDoSuffix))
|
1736
|
+
return;
|
1737
|
+
doSuffix = refDoSuffix.value;
|
1738
|
+
if (form != null) {
|
1739
|
+
if ((task.getMode() !== Constants.TASK_MODE_CREATE) || !task.ConfirmUpdateNo)
|
1740
|
+
await form.addRec(doSuffix, intEvtCode == InternalInterface.MG_ACT_CRELINE_ABOVE ? true : false);
|
1741
|
+
}
|
1742
|
+
await this.DoTaskLevelRecordPrefix(task);
|
1743
|
+
await this.HandleActEnterRowEditing(task);
|
1744
|
+
}
|
1745
|
+
finally {
|
1746
|
+
task.setInCreateLine(false);
|
1747
|
+
}
|
1748
|
+
break;
|
1749
|
+
case InternalInterface.MG_ACT_CANCEL:
|
1750
|
+
await this.HandleActCancel(evt, task, form, ctrl, rec, true);
|
1751
|
+
break;
|
1752
|
+
case InternalInterface.MG_ACT_ENTER_ROW_EDITING:
|
1753
|
+
await this.HandleActEnterRowEditing(task);
|
1754
|
+
break;
|
1755
|
+
case InternalInterface.MG_ACT_RT_QUIT:
|
1756
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_RT_QUIT);
|
1757
|
+
break;
|
1758
|
+
case InternalInterface.MG_ACT_RTO_CREATE:
|
1759
|
+
if (task.getMode() === Constants.TASK_MODE_CREATE ||
|
1760
|
+
await (task.getProp(PropInterface.PROP_TYPE_ALLOW_OPTION)).getValueBoolean()) {
|
1761
|
+
await this.gotoCreateMode(task);
|
1762
|
+
}
|
1763
|
+
break;
|
1764
|
+
case InternalInterface.MG_ACT_RTO_QUERY:
|
1765
|
+
if (task.getMode() !== Constants.TASK_MODE_QUERY &&
|
1766
|
+
(await (task.getProp(PropInterface.PROP_TYPE_ALLOW_OPTION)).getValueBoolean()) === false)
|
1767
|
+
break;
|
1768
|
+
await task.enableModes();
|
1769
|
+
oldMode = task.getOriginalTaskMode();
|
1770
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1771
|
+
if (!this.GetStopExecutionFlag()) {
|
1772
|
+
task.setMode(Constants.TASK_MODE_QUERY);
|
1773
|
+
if (oldMode !== Constants.TASK_MODE_CREATE) {
|
1774
|
+
await dv.currRecCompute(true);
|
1775
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1776
|
+
if (ctrl != null)
|
1777
|
+
await ctrl.invoke();
|
1778
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
1779
|
+
}
|
1780
|
+
else {
|
1781
|
+
task.setPreventRecordSuffix(true);
|
1782
|
+
task.setPreventControlChange(true);
|
1783
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_RT_REFRESH_VIEW);
|
1784
|
+
if (ctrl != null)
|
1785
|
+
await ctrl.invoke();
|
1786
|
+
task.setPreventRecordSuffix(false);
|
1787
|
+
task.setPreventControlChange(false);
|
1788
|
+
if (!dv.isEmpty() && (dv.getCurrRec()).getMode() !== DataModificationTypes.Insert)
|
1789
|
+
task.setMode(Constants.TASK_MODE_QUERY);
|
1790
|
+
else
|
1791
|
+
task.setMode(Constants.TASK_MODE_CREATE);
|
1792
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
1793
|
+
}
|
1794
|
+
task.setOriginalTaskMode(Constants.TASK_MODE_QUERY);
|
1795
|
+
await task.setCreateDeleteActsEnableState();
|
1796
|
+
}
|
1797
|
+
break;
|
1798
|
+
case InternalInterface.MG_ACT_RTO_MODIFY:
|
1799
|
+
if (task.getMode() !== Constants.TASK_MODE_MODIFY &&
|
1800
|
+
(await (task.getProp(PropInterface.PROP_TYPE_ALLOW_OPTION)).getValueBoolean()) === false)
|
1801
|
+
break;
|
1802
|
+
await task.enableModes();
|
1803
|
+
oldMode = task.getOriginalTaskMode();
|
1804
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1805
|
+
if (!this.GetStopExecutionFlag()) {
|
1806
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
1807
|
+
if (oldMode !== Constants.TASK_MODE_CREATE) {
|
1808
|
+
await dv.currRecCompute(true);
|
1809
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1810
|
+
if (ctrl != null)
|
1811
|
+
await ctrl.invoke();
|
1812
|
+
}
|
1813
|
+
else {
|
1814
|
+
task.setPreventRecordSuffix(true);
|
1815
|
+
task.setPreventControlChange(true);
|
1816
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_RT_REFRESH_VIEW);
|
1817
|
+
if (ctrl != null)
|
1818
|
+
await ctrl.invoke();
|
1819
|
+
task.setPreventRecordSuffix(false);
|
1820
|
+
task.setPreventControlChange(false);
|
1821
|
+
if (!dv.isEmpty() && (dv.getCurrRec()).getMode() !== DataModificationTypes.Insert)
|
1822
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
1823
|
+
else
|
1824
|
+
task.setMode(Constants.TASK_MODE_CREATE);
|
1825
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
1826
|
+
}
|
1827
|
+
task.setOriginalTaskMode(Constants.TASK_MODE_MODIFY);
|
1828
|
+
await task.setCreateDeleteActsEnableState();
|
1829
|
+
}
|
1830
|
+
break;
|
1831
|
+
case InternalInterface.MG_ACT_SELECT:
|
1832
|
+
try {
|
1833
|
+
task.InSelect = true;
|
1834
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1835
|
+
}
|
1836
|
+
finally {
|
1837
|
+
task.InSelect = false;
|
1838
|
+
}
|
1839
|
+
if (!this._stopExecution) {
|
1840
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_EXIT);
|
1841
|
+
}
|
1842
|
+
break;
|
1843
|
+
case InternalInterface.MG_ACT_SUBFORM_REFRESH:
|
1844
|
+
if ((evt.getArgList() != null) && (evt.getArgList().getSize() === 1)) {
|
1845
|
+
let subformCtrl = null;
|
1846
|
+
let RefreshedSubformName = await evt.getArgList().getArgValue(0, StorageAttribute.ALPHA, 0);
|
1847
|
+
if (RefreshedSubformName == null)
|
1848
|
+
break;
|
1849
|
+
for (let parentTask = task; parentTask.getForm() != null && parentTask.getMgdID() === task.getMgdID(); parentTask = parentTask.getParent()) {
|
1850
|
+
subformCtrl = parentTask.getForm().getCtrlByName(RefreshedSubformName.trim(), MgControlType.CTRL_TYPE_SUBFORM);
|
1851
|
+
if (subformCtrl != null) {
|
1852
|
+
let subformTask = subformCtrl.getSubformTask();
|
1853
|
+
if (subformTask == null) {
|
1854
|
+
if (await (subformCtrl.getProp(PropInterface.PROP_TYPE_SUBFORM_TYPE)).getValueInt() !== SubformType.None)
|
1855
|
+
await this.OpenSubform(parentTask, subformCtrl);
|
1856
|
+
}
|
1857
|
+
else
|
1858
|
+
await parentTask.SubformRefresh(subformTask, true);
|
1859
|
+
break;
|
1860
|
+
}
|
1861
|
+
}
|
1862
|
+
}
|
1863
|
+
else if ((evt.getArgList() != null) && (evt.getArgList().getSize() === 2)) {
|
1864
|
+
let subformTask = task, parentTask;
|
1865
|
+
let taskTag = await evt.getArgList().getArgValue(1, StorageAttribute.NUMERIC, 0);
|
1866
|
+
while (subformTask.IsSubForm) {
|
1867
|
+
parentTask = subformTask.getParent();
|
1868
|
+
if (subformTask.getTaskTag() === taskTag) {
|
1869
|
+
await parentTask.SubformRefresh(subformTask, true);
|
1870
|
+
break;
|
1871
|
+
}
|
1872
|
+
subformTask = parentTask;
|
1873
|
+
}
|
1874
|
+
}
|
1875
|
+
break;
|
1876
|
+
case InternalInterface.MG_ACT_SUBFORM_OPEN:
|
1877
|
+
await this.OpenSubform(task, evt.Control);
|
1878
|
+
break;
|
1879
|
+
case InternalInterface.MG_ACT_RTO_SEARCH:
|
1880
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1881
|
+
if (!this.GetStopExecutionFlag()) {
|
1882
|
+
cmd = CommandFactory.CreateEventCommand(task.getTaskTag(), intEvtCode);
|
1883
|
+
task.getTaskCache().clearCache();
|
1884
|
+
await task.DataviewManager.Execute(cmd);
|
1885
|
+
if (!form.isScreenMode()) {
|
1886
|
+
dv.setTopRecIdx(0);
|
1887
|
+
if (form.HasTable()) {
|
1888
|
+
await form.restoreOldDisplayLine(form.recordIdx2DisplayLine(dv.getCurrRecIdx()));
|
1889
|
+
}
|
1890
|
+
}
|
1891
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1892
|
+
if (ctrl != null)
|
1893
|
+
await ctrl.invoke();
|
1894
|
+
}
|
1895
|
+
break;
|
1896
|
+
case InternalInterface.MG_ACT_RT_REFRESH_SCREEN:
|
1897
|
+
case InternalInterface.MG_ACT_RT_REFRESH_VIEW:
|
1898
|
+
case InternalInterface.MG_ACT_RT_REFRESH_RECORD:
|
1899
|
+
await this.handleRefreshEvents(evt);
|
1900
|
+
break;
|
1901
|
+
case InternalInterface.MG_ACT_ACT_CLOSE_APPL:
|
1902
|
+
cmd =
|
1903
|
+
CommandFactory.CreateEventCommand(MGDataCollection.Instance.StartupMgData.getFirstTask().getTaskTag(), InternalInterface.MG_ACT_BROWSER_ESC);
|
1904
|
+
cmdsToServer.Add(cmd);
|
1905
|
+
await server.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
1906
|
+
break;
|
1907
|
+
case InternalInterface.MG_ACT_CONTEXT_REMOVE:
|
1908
|
+
let currRecord = LastFocusedManager.Instance.getLastFocusedTask().DataView.getCurrRec();
|
1909
|
+
if (ClientManager.TransCacheExists() || (currRecord != null && currRecord.Modified)) {
|
1910
|
+
console.log('Pending transaction/record is modified, discarded \'Context Remove\' event.');
|
1911
|
+
}
|
1912
|
+
else {
|
1913
|
+
if (Environment.Instance.getClientContextInactivityTimeout() > 0) {
|
1914
|
+
await this.ExecuteClientContextInactivityTimer();
|
1915
|
+
}
|
1916
|
+
if (!EventsManager.clientContextInactivityTimerAborted) {
|
1917
|
+
let contextTerminationEventCommand = CommandFactory.CreateContextTerminationEventCommand(MGDataCollection.Instance.StartupMgData.getFirstTask().getTaskTag());
|
1918
|
+
MGDataCollection.Instance.getCurrMGData().CmdsToServer.Add(contextTerminationEventCommand);
|
1919
|
+
RemoteCommandsProcessor.GetInstance().Execute(CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS);
|
1920
|
+
console.log('Removed context from server');
|
1921
|
+
RuntimeContextBase.Instance.RemovingContextFromServer = true;
|
1922
|
+
}
|
1923
|
+
else {
|
1924
|
+
console.log('Discarded \'Context Remove\' event as user event occurred.');
|
1925
|
+
EventsManager.clientContextInactivityTimerAborted = false;
|
1926
|
+
break;
|
1927
|
+
}
|
1928
|
+
}
|
1929
|
+
break;
|
1930
|
+
case InternalInterface.MG_ACT_SERVER_TERMINATION:
|
1931
|
+
case InternalInterface.MG_ACT_DUMP_ENVIRONMENT:
|
1932
|
+
cmd = CommandFactory.CreateEventCommand(task.getTaskTag(), intEvtCode);
|
1933
|
+
cmdsToServer.Add(cmd);
|
1934
|
+
await CommandsProcessorManager.GetCommandsProcessor().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
1935
|
+
break;
|
1936
|
+
case InternalInterface.MG_ACT_RT_EDT_NULL:
|
1937
|
+
if (this._currField != null && this._currField.NullAllowed) {
|
1938
|
+
await this._currField.setValueAndStartRecompute(this._currField.getMagicDefaultValue(), true, true, true, false);
|
1939
|
+
await this._currField.updateDisplay();
|
1940
|
+
}
|
1941
|
+
break;
|
1942
|
+
case InternalInterface.MG_ACT_ROLLBACK:
|
1943
|
+
await EventsManager.HandleRollbackAction(task, cmdsToServer, RollbackEventCommand_RollbackType.ROLLBACK);
|
1944
|
+
break;
|
1945
|
+
case InternalInterface.MG_ACT_OK:
|
1946
|
+
case InternalInterface.MG_ACT_INDEX_CHANGE:
|
1947
|
+
case InternalInterface.MG_ACT_COL_SORT:
|
1948
|
+
if ((intEvtCode === InternalInterface.MG_ACT_INDEX_CHANGE && task.DataviewManager.HasRemoteData) ||
|
1949
|
+
(intEvtCode === InternalInterface.MG_ACT_COL_SORT && ctrl.getField() != null)) {
|
1950
|
+
let lastFocusedTask = LastFocusedManager.Instance.getLastFocusedTask();
|
1951
|
+
let focusedCtrl = LastFocusedManager.getLastFocusedControl(LastFocusedManager.LastFocusMgdID);
|
1952
|
+
if (focusedCtrl != null)
|
1953
|
+
await this.handleInternalEventWithMgControlBase(focusedCtrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
|
1954
|
+
if (!this.GetStopExecutionFlag())
|
1955
|
+
await task.ExecuteNestedRS(lastFocusedTask);
|
1956
|
+
if (!this.GetStopExecutionFlag() && task.getLevel() !== Constants.TASK_LEVEL_TASK)
|
1957
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1958
|
+
if (!this.GetStopExecutionFlag()) {
|
1959
|
+
task.getTaskCache().clearCache();
|
1960
|
+
if (intEvtCode === InternalInterface.MG_ACT_INDEX_CHANGE) {
|
1961
|
+
let taskForm = task.getForm();
|
1962
|
+
if (taskForm.HasTable())
|
1963
|
+
form.clearTableColumnSortMark(true);
|
1964
|
+
cmd = await CommandFactory.CreateIndexChangeCommand(task.getTaskTag(), task.DataView.GetCurrentRecId(), evt.getArgList());
|
1965
|
+
}
|
1966
|
+
else {
|
1967
|
+
cmd = CommandFactory.CreateColumnSortCommand(task.getTaskTag(), evt.Direction, ctrl.getDitIdx(), ctrl.getField().getId(), task.DataView.GetCurrentRecId());
|
1968
|
+
}
|
1969
|
+
await task.DataviewManager.Execute(cmd);
|
1970
|
+
dv.setTopRecIdx(0);
|
1971
|
+
await form.restoreOldDisplayLine(0);
|
1972
|
+
if (!(task === LastFocusedManager.Instance.getLastFocusedTask() || !task.pathContains(LastFocusedManager.Instance.getLastFocusedTask()))) {
|
1973
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1974
|
+
if (!this.GetStopExecutionFlag() && !task.getPreventControlChange())
|
1975
|
+
await lastFocusedTask.ExecuteNestedRS(task);
|
1976
|
+
if (!this.GetStopExecutionFlag() && focusedCtrl != null)
|
1977
|
+
await focusedCtrl.invoke();
|
1978
|
+
}
|
1979
|
+
else
|
1980
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1981
|
+
}
|
1982
|
+
}
|
1983
|
+
break;
|
1984
|
+
case InternalInterface.MG_ACT_COL_CLICK:
|
1985
|
+
if (!this.GetStopExecutionFlag() && evt.isGuiTriggeredEvent() && ctrl.isColumnSortable()) {
|
1986
|
+
let columnChildControl = ctrl.getColumnChildControl();
|
1987
|
+
if (columnChildControl != null) {
|
1988
|
+
let aRtEvt = new RunTimeEvent(columnChildControl, evt.Direction, 0);
|
1989
|
+
aRtEvt.setInternal(InternalInterface.MG_ACT_COL_SORT);
|
1990
|
+
this.addToTail(aRtEvt);
|
1991
|
+
}
|
1992
|
+
}
|
1993
|
+
break;
|
1994
|
+
}
|
1995
|
+
}
|
1996
|
+
}
|
1997
|
+
finally {
|
1998
|
+
this.popRtEvent();
|
1999
|
+
}
|
2000
|
+
}
|
2001
|
+
async HandleActEnterRowEditing(task) {
|
2002
|
+
if (task.getMode() === Constants.TASK_MODE_QUERY)
|
2003
|
+
task.WriteToMessagePane(`Cannot enter Row Editing when in Query Mode.`);
|
2004
|
+
else {
|
2005
|
+
let myform = task.getForm();
|
2006
|
+
await myform.startRowEditing(myform.DisplayLine);
|
2007
|
+
}
|
2008
|
+
}
|
2009
|
+
async HandleStopRowEditing(task) {
|
2010
|
+
let myform = task.getForm();
|
2011
|
+
await myform.stopRowEditing(myform.DisplayLine);
|
2012
|
+
}
|
2013
|
+
async OpenSubform(task, subformControl) {
|
2014
|
+
task.TaskService.RemoveRecomputes(task);
|
2015
|
+
let cmd = CommandFactory.CreateSubformOpenCommand(task.getTaskTag(), subformControl.getDitIdx());
|
2016
|
+
task.getMGData().CmdsToServer.Add(cmd);
|
2017
|
+
await Task.CommandsProcessor.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
2018
|
+
}
|
2019
|
+
static async HandleRollbackAction(task, cmdsToServer, rollbackType) {
|
2020
|
+
let commandsProcessor = Task.CommandsProcessor;
|
2021
|
+
ClientRefreshCommand.ClientIsInRollbackCommand = true;
|
2022
|
+
task = task.TaskService.GetOwnerTransactionTask(task);
|
2023
|
+
let cmd = CommandFactory.CreateRollbackEventCommand(task.getTaskTag(), rollbackType);
|
2024
|
+
cmdsToServer.Add(cmd);
|
2025
|
+
await commandsProcessor.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
2026
|
+
ClientRefreshCommand.ClientIsInRollbackCommand = false;
|
2027
|
+
}
|
2028
|
+
async HandleActCancel(evt, task, form, ctrl, rec, isMG_ACT_CANCEL) {
|
2029
|
+
if (task.InHandleActCancel)
|
2030
|
+
return;
|
2031
|
+
task.InHandleActCancel = true;
|
2032
|
+
let oldMode = task.getMode();
|
2033
|
+
let saveDisplayLine = task.getForm().DisplayLine;
|
2034
|
+
if (oldMode !== Constants.TASK_MODE_QUERY && !rec.Updated) {
|
2035
|
+
if (isMG_ACT_CANCEL) {
|
2036
|
+
if (rec.Modified || (task.getLastParkedCtrl() !== null && task.getLastParkedCtrl().ModifiedByUser)) {
|
2037
|
+
if (await task.checkProp(PropInterface.PROP_TYPE_CONFIRM_CANCEL, false)) {
|
2038
|
+
let confirmed = await GUIManager.Instance.confirm_bool(MsgInterface.CONFIRM_STR_CANCEL);
|
2039
|
+
if (!confirmed) {
|
2040
|
+
task.InHandleActCancel = false;
|
2041
|
+
return;
|
2042
|
+
}
|
2043
|
+
}
|
2044
|
+
}
|
2045
|
+
}
|
2046
|
+
let oldRecMode = rec.getMode();
|
2047
|
+
if (GuiEnvironment.Environment.GetSpecialCancelOnCreate() && task.getMode() == Constants.TASK_MODE_CREATE
|
2048
|
+
&& task.getOriginalTaskMode() == Constants.TASK_MODE_CREATE) {
|
2049
|
+
let enable = await task.checkProp(PropInterface.PROP_TYPE_ALLOW_MODIFY, true);
|
2050
|
+
if (enable) {
|
2051
|
+
let allowEmptyDataView = await task.checkProp(PropInterface.PROP_TYPE_ALLOW_EMPTY_DATAVIEW, true);
|
2052
|
+
if (task.DataView.getSize() == 1 && allowEmptyDataView) {
|
2053
|
+
task.setMode('M');
|
2054
|
+
task.DataView.setEmptyDataview(true);
|
2055
|
+
}
|
2056
|
+
}
|
2057
|
+
}
|
2058
|
+
if (isMG_ACT_CANCEL) {
|
2059
|
+
if (task.isTransactionOnLevel(ConstInterface.TRANS_RECORD_PREFIX) && evt.RollbackInCancel()) {
|
2060
|
+
await EventsManager.HandleRollbackAction(task, task.getMGData().CmdsToServer, RollbackEventCommand_RollbackType.CANCEL);
|
2061
|
+
}
|
2062
|
+
}
|
2063
|
+
await EventsManager.HandleCancelEdit(evt, task, form, rec, oldRecMode);
|
2064
|
+
}
|
2065
|
+
else {
|
2066
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
2067
|
+
let lastFocusedControl = LastFocusedManager.getLastFocusedControl();
|
2068
|
+
if (lastFocusedControl !== null) {
|
2069
|
+
lastFocusedControl.getForm().getTask().setLevel(Constants.TASK_LEVEL_TASK);
|
2070
|
+
}
|
2071
|
+
if (!evt.isQuit()) {
|
2072
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2073
|
+
await this.HandleParkabilityOnRowChange(task);
|
2074
|
+
}
|
2075
|
+
}
|
2076
|
+
if (evt.isQuit())
|
2077
|
+
await this.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_EXIT);
|
2078
|
+
await form.stopRowEditing(saveDisplayLine);
|
2079
|
+
task.InHandleActCancel = false;
|
2080
|
+
}
|
2081
|
+
static async HandleCancelEdit(evt, task, form, rec, oldRecMode) {
|
2082
|
+
if (rec.Synced && oldRecMode === DataModificationTypes.Insert)
|
2083
|
+
rec.setMode(oldRecMode);
|
2084
|
+
if (form !== null) {
|
2085
|
+
if (task.getLastParkedCtrl() !== null)
|
2086
|
+
task.getLastParkedCtrl().resetPrevVal();
|
2087
|
+
await form.cancelEdit(true, evt.isQuit());
|
2088
|
+
}
|
2089
|
+
}
|
2090
|
+
async HandleActionDelline(task, dv, rec, nonInteractiveDelete) {
|
2091
|
+
let lastParkedCtrl;
|
2092
|
+
let myform = task.getForm();
|
2093
|
+
let saveIsRowEditing = myform.getIsRowEditingFromGui(myform.DisplayLine);
|
2094
|
+
let oldRecMode;
|
2095
|
+
if (await task.checkProp(PropInterface.PROP_TYPE_ALLOW_DELETE, true)) {
|
2096
|
+
lastParkedCtrl = task.getLastParkedCtrl();
|
2097
|
+
if (lastParkedCtrl !== null)
|
2098
|
+
await this.handleInternalEventWithMgControlBase(lastParkedCtrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
|
2099
|
+
if (!this.GetStopExecutionFlag()) {
|
2100
|
+
oldRecMode = rec.getMode();
|
2101
|
+
rec.clearMode();
|
2102
|
+
rec.setMode(DataModificationTypes.Delete);
|
2103
|
+
if (oldRecMode === DataModificationTypes.Insert)
|
2104
|
+
rec.setSendToServer(false);
|
2105
|
+
if (rec.Modified || await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false)) {
|
2106
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
2107
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
2108
|
+
if (this._stopExecution) {
|
2109
|
+
if (!rec.SendToServer) {
|
2110
|
+
await dv.addCurrToModified();
|
2111
|
+
rec.setSendToServer(true);
|
2112
|
+
}
|
2113
|
+
rec.clearMode();
|
2114
|
+
rec.setMode(oldRecMode);
|
2115
|
+
this.setStopExecution(false);
|
2116
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2117
|
+
this.setStopExecution(true);
|
2118
|
+
return true;
|
2119
|
+
}
|
2120
|
+
}
|
2121
|
+
rec.setInDeleteProcess(true);
|
2122
|
+
task.setMode(Constants.TASK_MODE_DELETE);
|
2123
|
+
let skipConfirmDialog = nonInteractiveDelete;
|
2124
|
+
if (!skipConfirmDialog) {
|
2125
|
+
if (task.mustConfirmInDeleteMode() || await task.checkProp(PropInterface.PROP_TYPE_CONFIRM_UPDATE, false)) {
|
2126
|
+
let confirmed = await GUIManager.Instance.confirm_bool(MsgInterface.CONFIRM_STR_DELETE);
|
2127
|
+
if (!confirmed) {
|
2128
|
+
rec.clearMode();
|
2129
|
+
rec.setMode(oldRecMode);
|
2130
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
2131
|
+
if (lastParkedCtrl !== null)
|
2132
|
+
await this.handleInternalEventWithMgControlBase(lastParkedCtrl, InternalInterface.MG_ACT_CTRL_PREFIX);
|
2133
|
+
if (saveIsRowEditing) {
|
2134
|
+
let myform = task.getForm();
|
2135
|
+
await myform.startRowEditing(myform.DisplayLine);
|
2136
|
+
}
|
2137
|
+
return true;
|
2138
|
+
}
|
2139
|
+
}
|
2140
|
+
}
|
2141
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
2142
|
+
rec.setInDeleteProcess(false);
|
2143
|
+
if (this._stopExecution) {
|
2144
|
+
if (!rec.SendToServer) {
|
2145
|
+
await dv.addCurrToModified();
|
2146
|
+
rec.setSendToServer(true);
|
2147
|
+
}
|
2148
|
+
rec.clearMode();
|
2149
|
+
rec.setMode(oldRecMode);
|
2150
|
+
this.setStopExecution(false);
|
2151
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
2152
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2153
|
+
this.setStopExecution(true);
|
2154
|
+
return true;
|
2155
|
+
}
|
2156
|
+
if (oldRecMode === DataModificationTypes.Insert) {
|
2157
|
+
rec.clearMode();
|
2158
|
+
rec.setMode(oldRecMode);
|
2159
|
+
}
|
2160
|
+
let newCurrRec = dv.getCurrRec();
|
2161
|
+
try {
|
2162
|
+
if (rec !== newCurrRec)
|
2163
|
+
await dv.setCurrRec(rec.getId(), false);
|
2164
|
+
if (!task.isAborting())
|
2165
|
+
await this.delCurrRec(task, false);
|
2166
|
+
}
|
2167
|
+
finally {
|
2168
|
+
if (rec !== newCurrRec) {
|
2169
|
+
await dv.setCurrRec(newCurrRec.getId(), false);
|
2170
|
+
if (dv.getSize() === 1)
|
2171
|
+
task.setMode(Constants.TASK_MODE_CREATE);
|
2172
|
+
}
|
2173
|
+
if (nonInteractiveDelete)
|
2174
|
+
task.setMode(Constants.TASK_MODE_DELETE);
|
2175
|
+
}
|
2176
|
+
}
|
2177
|
+
}
|
2178
|
+
return false;
|
2179
|
+
}
|
2180
|
+
async handleRefreshEvents(evt) {
|
2181
|
+
let task = evt.getTask();
|
2182
|
+
let form = task.getForm();
|
2183
|
+
let dv = task.DataView;
|
2184
|
+
let intEvtCode = evt.getInternalCode();
|
2185
|
+
let cmd = null;
|
2186
|
+
if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_RECORD)
|
2187
|
+
this._isInRecordFlushEvent = true;
|
2188
|
+
if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_VIEW && task.getMode() === Constants.TASK_MODE_CREATE && !await task.checkProp(PropInterface.PROP_TYPE_ALLOW_MODIFY, true)) {
|
2189
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_EXIT);
|
2190
|
+
}
|
2191
|
+
else {
|
2192
|
+
await task.ExecuteNestedRS(LastFocusedManager.Instance.getLastFocusedTask());
|
2193
|
+
if (!this.GetStopExecutionFlag()) {
|
2194
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
2195
|
+
}
|
2196
|
+
if (!this.GetStopExecutionFlag() && !task.InEndTask && !task.isAborting()) {
|
2197
|
+
if (intEvtCode !== InternalInterface.MG_ACT_RT_REFRESH_SCREEN) {
|
2198
|
+
let currentRow = 0;
|
2199
|
+
if (!evt.getRefreshType()) {
|
2200
|
+
if (evt.RtViewRefreshUseCurrentRow() && task.IsInteractive) {
|
2201
|
+
currentRow = form.getCurrRecPosInForm();
|
2202
|
+
}
|
2203
|
+
cmd = CommandFactory.CreateInternalRefreshCommand(task.getTaskTag(), intEvtCode, dv.CurrentRecId, currentRow);
|
2204
|
+
}
|
2205
|
+
else {
|
2206
|
+
if (task.IsInteractive)
|
2207
|
+
currentRow = form.getCurrRecPosInForm();
|
2208
|
+
let refetchRecord = true;
|
2209
|
+
if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_RECORD && evt.getArgList() !== null && evt.getArgList().getSize() !== 0) {
|
2210
|
+
let refetchRecStr;
|
2211
|
+
refetchRecStr = await evt.getArgList().getArgValue(0, StorageAttribute.BOOLEAN, 0);
|
2212
|
+
refetchRecord = (isNullOrUndefined(refetchRecStr) || refetchRecStr === '1');
|
2213
|
+
}
|
2214
|
+
if (refetchRecord)
|
2215
|
+
cmd = await CommandFactory.CreateRealRefreshCommand(task.getTaskTag(), intEvtCode, currentRow, evt.getArgList(), dv.CurrentRecId);
|
2216
|
+
}
|
2217
|
+
}
|
2218
|
+
else {
|
2219
|
+
let id;
|
2220
|
+
if (task.getForm() === null)
|
2221
|
+
id = 0;
|
2222
|
+
else if (task.getForm().isScreenMode())
|
2223
|
+
id = (task.DataView.getCurrRec()).getId();
|
2224
|
+
else
|
2225
|
+
id = task.DataView.getRecByIdx(task.DataView.getTopRecIdx()).getId();
|
2226
|
+
cmd = CommandFactory.CreateScreenRefreshCommand(task.getTaskTag(), id, dv.CurrentRecId);
|
2227
|
+
}
|
2228
|
+
if (intEvtCode !== InternalInterface.MG_ACT_RT_REFRESH_SCREEN)
|
2229
|
+
task.getTaskCache().clearCache();
|
2230
|
+
if (cmd !== null)
|
2231
|
+
await task.DataviewManager.Execute(cmd);
|
2232
|
+
this._isInRecordFlushEvent = false;
|
2233
|
+
if (!this.GetStopExecutionFlag() && !task.InEndTask && !task.isAborting()) {
|
2234
|
+
if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_VIEW && !form.isScreenMode()) {
|
2235
|
+
dv.setTopRecIdx(0);
|
2236
|
+
if (form.HasTable()) {
|
2237
|
+
form.clearTableColumnSortMark(true);
|
2238
|
+
await form.restoreOldDisplayLine(form.recordIdx2DisplayLine(dv.getCurrRecIdx()));
|
2239
|
+
}
|
2240
|
+
}
|
2241
|
+
if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_RECORD && task.getMode() !== Constants.TASK_MODE_QUERY && !task.getAfterRetry()) {
|
2242
|
+
if (task.getMode() === Constants.TASK_MODE_CREATE) {
|
2243
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
2244
|
+
(task.DataView.getCurrRec()).setOldRec();
|
2245
|
+
}
|
2246
|
+
await dv.currRecCompute(true);
|
2247
|
+
}
|
2248
|
+
else if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_SCREEN && task.getMode() !== Constants.TASK_MODE_QUERY && !task.getAfterRetry()) {
|
2249
|
+
await dv.currRecCompute(true);
|
2250
|
+
}
|
2251
|
+
this.setIsInViewRefresh(true);
|
2252
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2253
|
+
if (!this.GetStopExecutionFlag() && !task.getPreventControlChange()) {
|
2254
|
+
if (!(task === LastFocusedManager.Instance.getLastFocusedTask() || !task.pathContains(LastFocusedManager.Instance.getLastFocusedTask())))
|
2255
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
2256
|
+
}
|
2257
|
+
}
|
2258
|
+
}
|
2259
|
+
}
|
2260
|
+
}
|
2261
|
+
async gotoCreateMode(task) {
|
2262
|
+
let cmd;
|
2263
|
+
await task.enableModes();
|
2264
|
+
await task.ExecuteNestedRS(LastFocusedManager.Instance.getLastFocusedTask());
|
2265
|
+
if (!this.GetStopExecutionFlag())
|
2266
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
2267
|
+
if (!this.GetStopExecutionFlag()) {
|
2268
|
+
cmd = CommandFactory.CreateEventCommand(task.getTaskTag(), InternalInterface.MG_ACT_RTO_CREATE);
|
2269
|
+
await task.DataviewManager.Execute(cmd);
|
2270
|
+
if (task.getLevel() === Constants.TASK_LEVEL_TASK)
|
2271
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2272
|
+
await this.HandleNonParkableControls(task);
|
2273
|
+
await task.setCreateDeleteActsEnableState();
|
2274
|
+
task.setOriginalTaskMode(Constants.TASK_MODE_CREATE);
|
2275
|
+
await this.HandleActEnterRowEditing(task);
|
2276
|
+
}
|
2277
|
+
}
|
2278
|
+
async commonHandlerAfter(evt, rcBefore) {
|
2279
|
+
let task = evt.getTask();
|
2280
|
+
let dv;
|
2281
|
+
let rec = null;
|
2282
|
+
let ctrl;
|
2283
|
+
let recModified = false;
|
2284
|
+
let recModeIsDelete = false;
|
2285
|
+
let forceSuffix;
|
2286
|
+
if (this._stopExecution && evt.getInternalCode() !== InternalInterface.MG_ACT_REC_SUFFIX && evt.getInternalCode() !== InternalInterface.MG_ACT_CTRL_SUFFIX)
|
2287
|
+
return;
|
2288
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
|
2289
|
+
dv = task.DataView;
|
2290
|
+
rec = dv.getCurrRec();
|
2291
|
+
ctrl = evt.Control;
|
2292
|
+
switch (evt.getInternalCode()) {
|
2293
|
+
case InternalInterface.MG_ACT_REC_PREFIX:
|
2294
|
+
if (rcBefore) {
|
2295
|
+
if (await task.CheckRefreshSubTasks())
|
2296
|
+
await task.doSubformRecPrefixSuffix();
|
2297
|
+
await task.handleEventOnSlaveTasks(InternalInterface.MG_ACT_REC_PREFIX);
|
2298
|
+
await task.enableModes();
|
2299
|
+
}
|
2300
|
+
break;
|
2301
|
+
case InternalInterface.MG_ACT_REC_SUFFIX:
|
2302
|
+
task.isFirstRecordCycle(false);
|
2303
|
+
if (task.getPreventRecordSuffix()) {
|
2304
|
+
task.setPreventRecordSuffix(false);
|
2305
|
+
return;
|
2306
|
+
}
|
2307
|
+
task.DoSubformPrefixSuffix = false;
|
2308
|
+
if (this._stopExecution) {
|
2309
|
+
if (rec.getMode() === DataModificationTypes.Delete)
|
2310
|
+
rec.clearMode();
|
2311
|
+
if (task.getLevel() !== Constants.TASK_LEVEL_CONTROL) {
|
2312
|
+
let last = this.getStopExecutionCtrl();
|
2313
|
+
if (last === null)
|
2314
|
+
last = task.getLastParkedCtrl();
|
2315
|
+
this.setStopExecution(false);
|
2316
|
+
this.setStopExecutionCtrl(null);
|
2317
|
+
if (last != null) {
|
2318
|
+
task.setLevel(Constants.TASK_LEVEL_RECORD);
|
2319
|
+
let inCtrlPrefix = task.InCtrlPrefix;
|
2320
|
+
task.InCtrlPrefix = false;
|
2321
|
+
await this.handleInternalEventWithMgControlBase(last, InternalInterface.MG_ACT_CTRL_PREFIX);
|
2322
|
+
task.InCtrlPrefix = inCtrlPrefix;
|
2323
|
+
}
|
2324
|
+
this.setStopExecution(true);
|
2325
|
+
}
|
2326
|
+
return;
|
2327
|
+
}
|
2328
|
+
else {
|
2329
|
+
await this.HandleStopRowEditing(task);
|
2330
|
+
}
|
2331
|
+
if (rec != null) {
|
2332
|
+
recModified = rec.Modified;
|
2333
|
+
if (!this._stopExecution && rec.isCauseInvalidation()) {
|
2334
|
+
task.getForm().invalidateTable();
|
2335
|
+
rec.setCauseInvalidation(false);
|
2336
|
+
}
|
2337
|
+
recModeIsDelete = (rec.getMode() === DataModificationTypes.Delete);
|
2338
|
+
forceSuffix = await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
|
2339
|
+
if (recModeIsDelete && task.getMode() === Constants.TASK_MODE_DELETE ||
|
2340
|
+
!recModeIsDelete && !rec.inDeleteProcess() && (recModified || forceSuffix)) {
|
2341
|
+
rec.setMode(DataModificationTypes.Update);
|
2342
|
+
await dv.addCurrToModified();
|
2343
|
+
dv.setChanged(true);
|
2344
|
+
if (recModified && task.getMode() === Constants.TASK_MODE_QUERY) {
|
2345
|
+
if (rec.realModified() &&
|
2346
|
+
!Environment.Instance.allowUpdateInQueryMode(task.getCompIdx())) {
|
2347
|
+
await dv.cancelEdit(EventsManager.REAL_ONLY, false);
|
2348
|
+
task.WriteToMessagePanebyMsgId(MsgInterface.RT_STR_UPDATE_IN_QUERY);
|
2349
|
+
await task.getForm().RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
2350
|
+
}
|
2351
|
+
}
|
2352
|
+
}
|
2353
|
+
if (!this.isForceExitPreRecordUpdate(task) &&
|
2354
|
+
(!task.isAborting() || MGDataCollection.Instance.GetTaskByID(task.getTaskTag()) != null)) {
|
2355
|
+
if ((!recModeIsDelete || task.getMode() === Constants.TASK_MODE_DELETE))
|
2356
|
+
await this.commitRecord(task, evt.reversibleExit());
|
2357
|
+
}
|
2358
|
+
if (!task.transactionFailed(ConstInterface.TRANS_RECORD_PREFIX) && !task.isAborting()) {
|
2359
|
+
if ((rec.getMode() === DataModificationTypes.Delete &&
|
2360
|
+
task.getMode() === Constants.TASK_MODE_DELETE) ||
|
2361
|
+
rec.getMode() !== DataModificationTypes.Delete)
|
2362
|
+
if (await task.evalEndCond(ConstInterface.END_COND_EVAL_AFTER))
|
2363
|
+
await task.endTask(true, false, false);
|
2364
|
+
}
|
2365
|
+
}
|
2366
|
+
break;
|
2367
|
+
case InternalInterface.MG_ACT_CTRL_PREFIX:
|
2368
|
+
if (rcBefore) {
|
2369
|
+
if (await ctrl.IsParkable() || ctrl === LastFocusedManager.getLastFocusedControl()) {
|
2370
|
+
ctrl.InControl = true;
|
2371
|
+
if (ctrl.ShouldRefreshOnControlEnter())
|
2372
|
+
await ctrl.getField().updateDisplay();
|
2373
|
+
task.setLastParkedCtrl(ctrl);
|
2374
|
+
RuntimeContextBase.Instance.CurrentClickedCtrl = null;
|
2375
|
+
await ctrl.SetFocus(ctrl, ctrl.getDisplayLine(false), true);
|
2376
|
+
this.setStopExecutionCtrl(null);
|
2377
|
+
MgControl.ReturnToCtrl = ctrl;
|
2378
|
+
task.InCtrlPrefix = false;
|
2379
|
+
}
|
2380
|
+
else {
|
2381
|
+
task.InCtrlPrefix = false;
|
2382
|
+
await this.HandleNonParkableControls(ctrl.getForm().getTask());
|
2383
|
+
}
|
2384
|
+
}
|
2385
|
+
break;
|
2386
|
+
case InternalInterface.MG_ACT_CTRL_SUFFIX:
|
2387
|
+
if (!this.GetStopExecutionFlag()) {
|
2388
|
+
if (ctrl.isChoiceControl()) {
|
2389
|
+
ctrl.SetKeyboardLanguage();
|
2390
|
+
}
|
2391
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_BUTTON)
|
2392
|
+
task.ActionManager.enable(InternalInterface.MG_ACT_BUTTON, false);
|
2393
|
+
if (task.getEnableZoomHandler() || ctrl.useZoomHandler())
|
2394
|
+
task.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, false);
|
2395
|
+
task.ActionManager.enable(InternalInterface.MG_ACT_RT_EDT_NULL, false);
|
2396
|
+
}
|
2397
|
+
if (rcBefore) {
|
2398
|
+
if (this.GetStopExecutionFlag()) {
|
2399
|
+
ctrl.InControl = true;
|
2400
|
+
return;
|
2401
|
+
}
|
2402
|
+
let fld = ctrl.getField();
|
2403
|
+
if (fld != null && (ctrl.Type === MgControlType.CTRL_TYPE_TEXT))
|
2404
|
+
await fld.updateDisplay();
|
2405
|
+
task.setLevel(Constants.TASK_LEVEL_RECORD);
|
2406
|
+
ctrl.setInControlSuffix(false);
|
2407
|
+
ctrl.IsInteractiveUpdate = false;
|
2408
|
+
if (ctrl.PropertyExists(PropInterface.PROP_TYPE_CUSTOM_VALIDATORS))
|
2409
|
+
await ctrl.getProp(PropInterface.PROP_TYPE_CUSTOM_VALIDATORS).RefreshDisplay(true);
|
2410
|
+
ctrl.ValidateControl = false;
|
2411
|
+
LastFocusedManager.setLastFocusedControl(task, null);
|
2412
|
+
if (await task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE))
|
2413
|
+
await task.endTask(true, false, false);
|
2414
|
+
}
|
2415
|
+
break;
|
2416
|
+
case InternalInterface.MG_ACT_TASK_PREFIX:
|
2417
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
2418
|
+
break;
|
2419
|
+
case InternalInterface.MG_ACT_TASK_SUFFIX:
|
2420
|
+
task.setLevel(Constants.TASK_LEVEL_NONE);
|
2421
|
+
break;
|
2422
|
+
case InternalInterface.MG_ACT_CYCLE_NEXT_REC:
|
2423
|
+
let form = task.getForm();
|
2424
|
+
if (!task.isMainProg() && form != null) {
|
2425
|
+
await form.moveInView(form.isLineMode()
|
2426
|
+
? Constants.MOVE_UNIT_ROW
|
2427
|
+
: Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_NEXT);
|
2428
|
+
if (task.getExecEndTask())
|
2429
|
+
await task.endTask(true, false, false);
|
2430
|
+
}
|
2431
|
+
break;
|
2432
|
+
case InternalInterface.MG_ACT_CYCLE_NEXT_DELETE_REC:
|
2433
|
+
if (task.DataView.isEmptyDataview())
|
2434
|
+
(task).setExecEndTask();
|
2435
|
+
else
|
2436
|
+
await this.HandleActionDelline(task, dv, rec, true);
|
2437
|
+
if (task.getExecEndTask())
|
2438
|
+
await task.endTask(true, false, false);
|
2439
|
+
break;
|
2440
|
+
case InternalInterface.MG_ACT_SET_EXTERNAL_VALUE:
|
2441
|
+
let refreshDisplay = await evt.getArgList().getArgValue(1, StorageAttribute.BOOLEAN, 0) === '1' ? true : false;
|
2442
|
+
await ctrl.validateAndSetValueIfAllowed(evt.getValue(), refreshDisplay);
|
2443
|
+
break;
|
2444
|
+
}
|
2445
|
+
}
|
2446
|
+
}
|
2447
|
+
async handleNonReversibleEvent(task, eventCode) {
|
2448
|
+
let rtEvt = new RunTimeEvent(task);
|
2449
|
+
let exitCommand = (eventCode === InternalInterface.MG_ACT_EXIT || eventCode === InternalInterface.MG_ACT_CLOSE);
|
2450
|
+
rtEvt.setInternal(eventCode);
|
2451
|
+
if (exitCommand)
|
2452
|
+
this._isNonReversibleExit = true;
|
2453
|
+
try {
|
2454
|
+
rtEvt.setNonReversibleExit();
|
2455
|
+
rtEvt.setCtrl(task.getLastParkedCtrl());
|
2456
|
+
rtEvt.setArgList(null);
|
2457
|
+
await this.handleEvent(rtEvt, false);
|
2458
|
+
}
|
2459
|
+
finally {
|
2460
|
+
if (exitCommand)
|
2461
|
+
this._isNonReversibleExit = false;
|
2462
|
+
}
|
2463
|
+
}
|
2464
|
+
async handleInternalEventWithTaskAndEventSubtype(task, eventCode, eventSubType) {
|
2465
|
+
let lastParkedCtrl = task.getLastParkedCtrl();
|
2466
|
+
let rtEvt;
|
2467
|
+
if (eventCode < InternalInterface.MG_ACT_TOT_CNT && task != null && !(eventSubType === EventSubType.CancelIsQuit) && !task.ActionManager.isEnabled(eventCode))
|
2468
|
+
return;
|
2469
|
+
if (lastParkedCtrl !== null)
|
2470
|
+
await this.handleInternalEventWithMgControl(lastParkedCtrl, eventCode, eventSubType);
|
2471
|
+
else {
|
2472
|
+
if (eventCode === InternalInterface.MG_ACT_RT_QUIT)
|
2473
|
+
await this.handleInternalEventWithTaskAndEventSubtype(task, InternalInterface.MG_ACT_CANCEL, EventSubType.CancelIsQuit);
|
2474
|
+
else {
|
2475
|
+
rtEvt = new RunTimeEvent(task);
|
2476
|
+
rtEvt.setInternal(eventCode);
|
2477
|
+
rtEvt.SetEventSubType(eventSubType);
|
2478
|
+
if (InternalInterface.BuiltinEvent(eventCode))
|
2479
|
+
await this.handleEvent(rtEvt, false);
|
2480
|
+
else
|
2481
|
+
await this.commonHandler(rtEvt);
|
2482
|
+
}
|
2483
|
+
}
|
2484
|
+
}
|
2485
|
+
async handleInternalEventWithMgControl(ctrl, eventCode, eventSubType) {
|
2486
|
+
let rtEvt;
|
2487
|
+
if (eventCode === InternalInterface.MG_ACT_RT_QUIT)
|
2488
|
+
await this.handleInternalEventWithMgControl(ctrl, InternalInterface.MG_ACT_CANCEL, EventSubType.CancelIsQuit);
|
2489
|
+
else {
|
2490
|
+
rtEvt = new RunTimeEvent(ctrl);
|
2491
|
+
rtEvt.setInternal(eventCode);
|
2492
|
+
rtEvt.SetEventSubType(eventSubType);
|
2493
|
+
if (eventCode === InternalInterface.MG_ACT_RT_REFRESH_VIEW)
|
2494
|
+
rtEvt.setIsRealRefresh(false);
|
2495
|
+
if (InternalInterface.BuiltinEvent(eventCode))
|
2496
|
+
await this.handleEvent(rtEvt, false);
|
2497
|
+
else
|
2498
|
+
await this.commonHandler(rtEvt);
|
2499
|
+
}
|
2500
|
+
}
|
2501
|
+
getCurrField() {
|
2502
|
+
return this._currField;
|
2503
|
+
}
|
2504
|
+
getCurrCtrl() {
|
2505
|
+
return this._currCtrl;
|
2506
|
+
}
|
2507
|
+
getCurrTask() {
|
2508
|
+
if (this._currField == null)
|
2509
|
+
return null;
|
2510
|
+
return this._currField.getTask();
|
2511
|
+
}
|
2512
|
+
setStopExecution(stop, clearEventsOnStopExecution) {
|
2513
|
+
if (arguments.length === 1)
|
2514
|
+
this.setStopExecution_0(stop);
|
2515
|
+
else
|
2516
|
+
this.setStopExecution_1(stop, clearEventsOnStopExecution);
|
2517
|
+
}
|
2518
|
+
setStopExecution_0(stop) {
|
2519
|
+
this.setStopExecution(stop, ClearEventsOnStopExecution.ALL);
|
2520
|
+
}
|
2521
|
+
setStopExecution_1(stop, clearEventsOnStopExecution) {
|
2522
|
+
if (stop)
|
2523
|
+
if (clearEventsOnStopExecution == ClearEventsOnStopExecution.ALL)
|
2524
|
+
this._eventsQueue.clear();
|
2525
|
+
else if (clearEventsOnStopExecution == ClearEventsOnStopExecution.SERVER) {
|
2526
|
+
let tmpVec = new List();
|
2527
|
+
let rtEvt;
|
2528
|
+
let i;
|
2529
|
+
while (!this._eventsQueue.isEmpty()) {
|
2530
|
+
rtEvt = this._eventsQueue.poll();
|
2531
|
+
if (rtEvt.isFromServer()) {
|
2532
|
+
rtEvt.resetFromServer();
|
2533
|
+
tmpVec.push(rtEvt);
|
2534
|
+
}
|
2535
|
+
}
|
2536
|
+
for (i = 0; i < tmpVec.length; i++)
|
2537
|
+
this._eventsQueue.put(tmpVec.get_Item(i));
|
2538
|
+
}
|
2539
|
+
this._stopExecution = stop;
|
2540
|
+
}
|
2541
|
+
setStopExecutionCtrl(ctrl) {
|
2542
|
+
if (this._stopExecutionCtrl === null || ctrl === null)
|
2543
|
+
this._stopExecutionCtrl = ctrl;
|
2544
|
+
}
|
2545
|
+
async delCurrRec(task, inForceDel) {
|
2546
|
+
let dv = task.DataView;
|
2547
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
2548
|
+
await task.getForm().delCurrRec();
|
2549
|
+
if (!task.DataView.isEmptyDataview()) {
|
2550
|
+
if (dv.getCurrRecIdx() >= 0) {
|
2551
|
+
if ((dv.getCurrRec()).getMode() !== DataModificationTypes.Delete && !inForceDel) {
|
2552
|
+
let ctrl = task.getLastParkedCtrl();
|
2553
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2554
|
+
if (!this.GetStopExecutionFlag())
|
2555
|
+
if (ctrl === null)
|
2556
|
+
await this.HandleNonParkableControls(task);
|
2557
|
+
else
|
2558
|
+
await this.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_CTRL_PREFIX);
|
2559
|
+
}
|
2560
|
+
}
|
2561
|
+
else if (!task.getInCreateLine())
|
2562
|
+
await this.handleNonReversibleEvent(task, InternalInterface.MG_ACT_EXIT);
|
2563
|
+
}
|
2564
|
+
else {
|
2565
|
+
await this.HandleNonParkableControls(task);
|
2566
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2567
|
+
}
|
2568
|
+
}
|
2569
|
+
async updateConfirmed(task) {
|
2570
|
+
let confirm;
|
2571
|
+
let answer;
|
2572
|
+
let ans;
|
2573
|
+
if (task == null)
|
2574
|
+
return false;
|
2575
|
+
confirm = await task.checkProp(PropInterface.PROP_TYPE_CONFIRM_UPDATE, false);
|
2576
|
+
if (!this._isInRecordFlushEvent && confirm && !task.DataSynced) {
|
2577
|
+
ans = await GUIManager.Instance.confirm(MsgInterface.CRF_STR_CONF_UPD, Styles.MSGBOX_ICON_QUESTION | Styles.MSGBOX_BUTTON_YES_NO_CANCEL);
|
2578
|
+
if (ans === Styles.MSGBOX_RESULT_YES)
|
2579
|
+
answer = 'Y';
|
2580
|
+
else if (ans === Styles.MSGBOX_RESULT_NO)
|
2581
|
+
answer = 'N';
|
2582
|
+
else
|
2583
|
+
answer = 'C';
|
2584
|
+
}
|
2585
|
+
else
|
2586
|
+
answer = 'Y';
|
2587
|
+
switch (answer) {
|
2588
|
+
case 'Y':
|
2589
|
+
break;
|
2590
|
+
case 'N':
|
2591
|
+
await task.getForm().cancelEdit(false, false);
|
2592
|
+
await task.getForm().RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
2593
|
+
task.ConfirmUpdateNo = true;
|
2594
|
+
return false;
|
2595
|
+
case 'C':
|
2596
|
+
this.setStopExecution(true);
|
2597
|
+
this.setStopExecutionCtrl(LastFocusedManager.getLastFocusedControl());
|
2598
|
+
await FocusManager.SetFocus(LastFocusedManager.getLastFocusedControl(), -1);
|
2599
|
+
return false;
|
2600
|
+
default:
|
2601
|
+
Logger.Instance.WriteExceptionToLogWithMsg('in ClientManager.Instance.updateConfirmed() illegal confirmation code: ' +
|
2602
|
+
confirm);
|
2603
|
+
break;
|
2604
|
+
}
|
2605
|
+
return true;
|
2606
|
+
}
|
2607
|
+
setCompMainPrgTab(compMainPrgTable) {
|
2608
|
+
this._compMainPrgTab = compMainPrgTable;
|
2609
|
+
}
|
2610
|
+
setEndOfWork(endOfWork_) {
|
2611
|
+
this._endOfWork = endOfWork_;
|
2612
|
+
}
|
2613
|
+
getEndOfWork() {
|
2614
|
+
return this._endOfWork;
|
2615
|
+
}
|
2616
|
+
getCompMainPrgTab() {
|
2617
|
+
return this._compMainPrgTab;
|
2618
|
+
}
|
2619
|
+
inNonReversibleExit() {
|
2620
|
+
return this._isNonReversibleExit;
|
2621
|
+
}
|
2622
|
+
pushRtEvent(rtEvt) {
|
2623
|
+
this._rtEvents.push(rtEvt);
|
2624
|
+
}
|
2625
|
+
popRtEvent() {
|
2626
|
+
if (this._rtEvents.count() === 0)
|
2627
|
+
return null;
|
2628
|
+
return this._rtEvents.pop();
|
2629
|
+
}
|
2630
|
+
storeLastSavedRouteEventOnLocalStorage() {
|
2631
|
+
let dataStorage = window.localStorage;
|
2632
|
+
if (this.getLastSavedRouteEvent() != null) {
|
2633
|
+
let rtEvt = this.getLastSavedRouteEvent();
|
2634
|
+
dataStorage.setItem(ConstInterface.LAST_ROUTE_EVENT, '1');
|
2635
|
+
dataStorage.setItem(ConstInterface.LAST_ROUTE_EVENT_SRC_TSK, JSON.stringify(rtEvt.getTask().TaskDefinitionId));
|
2636
|
+
if (rtEvt.getArgList().getSize() > 0) {
|
2637
|
+
let str = new StringBuilder();
|
2638
|
+
rtEvt.getArgList().buildXML(str);
|
2639
|
+
dataStorage.setItem(ConstInterface.LAST_ROUTE_EVENT_ARG_LIST, str.toString());
|
2640
|
+
}
|
2641
|
+
}
|
2642
|
+
}
|
2643
|
+
restoreLastSavedRouteEventFromLocalStorage() {
|
2644
|
+
let dataStorage = window.localStorage;
|
2645
|
+
let lastRouteEvent = dataStorage.getItem(ConstInterface.LAST_ROUTE_EVENT);
|
2646
|
+
if (lastRouteEvent === '1') {
|
2647
|
+
let srcTaskDefinitionStr = dataStorage.getItem(ConstInterface.LAST_ROUTE_EVENT_SRC_TSK);
|
2648
|
+
let routeArgListStr = dataStorage.getItem(ConstInterface.LAST_ROUTE_EVENT_ARG_LIST);
|
2649
|
+
let taskDefinitionId = new TaskDefinitionId();
|
2650
|
+
taskDefinitionId.fromJSON(srcTaskDefinitionStr);
|
2651
|
+
let srcTask = MGDataCollection.Instance.getCurrMGData().getTaskByTaskDefinitionID(taskDefinitionId);
|
2652
|
+
let args = null;
|
2653
|
+
if (routeArgListStr != null) {
|
2654
|
+
args = new ArgumentsList();
|
2655
|
+
args.fillList(routeArgListStr, srcTask);
|
2656
|
+
}
|
2657
|
+
EventsManager.Instance.AddLastSavedRouteEvent(srcTask, args);
|
2658
|
+
}
|
2659
|
+
}
|
2660
|
+
getLastSavedRouteEvent() {
|
2661
|
+
return this.lastSavedRouteEvent;
|
2662
|
+
}
|
2663
|
+
setLastSavedRouteEvent(rtEvt) {
|
2664
|
+
if (rtEvt == null)
|
2665
|
+
this.lastSavedRouteEvent = null;
|
2666
|
+
else
|
2667
|
+
this.lastSavedRouteEvent = rtEvt.replicate();
|
2668
|
+
}
|
2669
|
+
getLastRtEvent() {
|
2670
|
+
if (this._rtEvents.count() === 0)
|
2671
|
+
return null;
|
2672
|
+
return this._rtEvents.peek();
|
2673
|
+
}
|
2674
|
+
setIgnoreUnknownAbort(val) {
|
2675
|
+
this._ignoreUnknownAbort = val;
|
2676
|
+
}
|
2677
|
+
ignoreUnknownAbort() {
|
2678
|
+
return this._ignoreUnknownAbort;
|
2679
|
+
}
|
2680
|
+
async failTaskOverlay(taskId, mgd) {
|
2681
|
+
let cmd;
|
2682
|
+
if (taskId !== null) {
|
2683
|
+
this.setIgnoreUnknownAbort(true);
|
2684
|
+
try {
|
2685
|
+
cmd = CommandFactory.CreateNonReversibleExitCommand(taskId, false);
|
2686
|
+
mgd.CmdsToServer.Add(cmd);
|
2687
|
+
await RemoteCommandsProcessor.GetInstance().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
2688
|
+
}
|
2689
|
+
finally {
|
2690
|
+
this.setIgnoreUnknownAbort(false);
|
2691
|
+
}
|
2692
|
+
}
|
2693
|
+
}
|
2694
|
+
isEventScopeTrans() {
|
2695
|
+
return this._eventScope === EventScope.TRANS;
|
2696
|
+
}
|
2697
|
+
setEventScopeTrans() {
|
2698
|
+
this._eventScope = EventScope.TRANS;
|
2699
|
+
}
|
2700
|
+
clearEventScope() {
|
2701
|
+
this._eventScope = EventScope.NONE;
|
2702
|
+
}
|
2703
|
+
GetEventTime() {
|
2704
|
+
return this._eventsQueue.GetTime();
|
2705
|
+
}
|
2706
|
+
getMatchingAction(kbItm) {
|
2707
|
+
let act = 0;
|
2708
|
+
if (kbItm == null)
|
2709
|
+
return act;
|
2710
|
+
if (act === 0) {
|
2711
|
+
if (kbItm.getAction() !== 0)
|
2712
|
+
act = kbItm.getAction();
|
2713
|
+
else if (kbItm.getKeyCode() === 45 && kbItm.getModifier() === Modifiers.MODIFIER_NONE && kbItm.getStates() === 0)
|
2714
|
+
act = InternalInterface.MG_ACT_TOGGLE_INSERT;
|
2715
|
+
}
|
2716
|
+
return (act);
|
2717
|
+
}
|
2718
|
+
getExecStack() {
|
2719
|
+
return this._execStack.peek();
|
2720
|
+
}
|
2721
|
+
pushExecStack(taskId, handlerId, operIdx) {
|
2722
|
+
this._execStack.peek().push(MGDataCollection.Instance.getTaskIdById(taskId), handlerId, operIdx);
|
2723
|
+
}
|
2724
|
+
popExecStack() {
|
2725
|
+
return this._execStack.peek().pop();
|
2726
|
+
}
|
2727
|
+
pushNewExecStacks() {
|
2728
|
+
this._serverExecStack.push(null);
|
2729
|
+
this._execStack.push(new ExecutionStack());
|
2730
|
+
}
|
2731
|
+
popNewExecStacks() {
|
2732
|
+
this._serverExecStack.pop();
|
2733
|
+
this._execStack.pop();
|
2734
|
+
}
|
2735
|
+
pushServerExecStack(taskId, handlerId, operIdx) {
|
2736
|
+
if (this._serverExecStack.peek() === null) {
|
2737
|
+
this._serverExecStack.pop();
|
2738
|
+
this._serverExecStack.push(new ExecutionStack());
|
2739
|
+
}
|
2740
|
+
this._serverExecStack.peek().push(taskId, handlerId, operIdx);
|
2741
|
+
}
|
2742
|
+
clearServerExecStack() {
|
2743
|
+
if (this._serverExecStack.peek() !== null) {
|
2744
|
+
this._serverExecStack.peek().clear();
|
2745
|
+
}
|
2746
|
+
}
|
2747
|
+
reverseServerExecStack() {
|
2748
|
+
if (this._serverExecStack.peek() !== null)
|
2749
|
+
this._serverExecStack.peek().reverse();
|
2750
|
+
}
|
2751
|
+
getNextOperIdx(oper, clearWhenFound) {
|
2752
|
+
let tmpServerExecStackEntry = null;
|
2753
|
+
let nextOperIdx = -1;
|
2754
|
+
if (this._serverExecStack.count() !== 0 && this._serverExecStack.peek() !== null && !this._serverExecStack.peek().empty()) {
|
2755
|
+
if (this._serverExecStack.peek().size() > this._execStack.peek().size()) {
|
2756
|
+
let tmpServerExecStack = new ExecutionStack(this._serverExecStack.peek());
|
2757
|
+
while (tmpServerExecStack.size() > this._execStack.peek().size()) {
|
2758
|
+
tmpServerExecStackEntry = tmpServerExecStack.pop();
|
2759
|
+
}
|
2760
|
+
if (this._execStack.peek().Equals(tmpServerExecStack) && tmpServerExecStackEntry.TaskId === oper.getTaskTag() && tmpServerExecStackEntry.HandlerId === oper.getHandlerId() && tmpServerExecStackEntry.OperIdx >= oper.getServerId()) {
|
2761
|
+
nextOperIdx = tmpServerExecStackEntry.OperIdx;
|
2762
|
+
if (clearWhenFound && this._serverExecStack.peek().size() === this._execStack.peek().size() + 1) {
|
2763
|
+
this._serverExecStack.peek().clear();
|
2764
|
+
}
|
2765
|
+
}
|
2766
|
+
else
|
2767
|
+
nextOperIdx = EventsManager.MAX_OPER;
|
2768
|
+
}
|
2769
|
+
else {
|
2770
|
+
nextOperIdx = EventsManager.MAX_OPER;
|
2771
|
+
}
|
2772
|
+
}
|
2773
|
+
return nextOperIdx;
|
2774
|
+
}
|
2775
|
+
setProcessingTopMostEndTask(inProcessingTopMostEndTask) {
|
2776
|
+
this._processingTopMostEndTask = inProcessingTopMostEndTask;
|
2777
|
+
}
|
2778
|
+
getProcessingTopMostEndTask() {
|
2779
|
+
return this._processingTopMostEndTask;
|
2780
|
+
}
|
2781
|
+
setAllowEvents(AllowEvents) {
|
2782
|
+
this._allowEvents = AllowEvents;
|
2783
|
+
}
|
2784
|
+
setNonInteractiveAllowEvents(AllowEvents) {
|
2785
|
+
if (AllowEvents)
|
2786
|
+
this._allowEvents = EventsAllowedType.NON_INTERACTIVE;
|
2787
|
+
else
|
2788
|
+
this._allowEvents = EventsAllowedType.NONE;
|
2789
|
+
}
|
2790
|
+
getAllowEvents() {
|
2791
|
+
return this._allowEvents;
|
2792
|
+
}
|
2793
|
+
NoEventsAllowed() {
|
2794
|
+
return this._allowEvents === EventsAllowedType.NONE;
|
2795
|
+
}
|
2796
|
+
async handleCtrlModify(ctrl, act) {
|
2797
|
+
if (ctrl == null || !ctrl.isModifiable())
|
2798
|
+
return;
|
2799
|
+
switch (act) {
|
2800
|
+
case InternalInterface.MG_ACT_RT_EDT_NULL:
|
2801
|
+
case InternalInterface.MG_ACT_CTRL_MODIFY:
|
2802
|
+
case InternalInterface.MG_ACT_SELECTION:
|
2803
|
+
break;
|
2804
|
+
default:
|
2805
|
+
return;
|
2806
|
+
}
|
2807
|
+
let rtEvt;
|
2808
|
+
rtEvt = new RunTimeEvent(ctrl);
|
2809
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_CTRL_MODIFY);
|
2810
|
+
await this.handleEvent(rtEvt, false);
|
2811
|
+
}
|
2812
|
+
ActAllowed(act) {
|
2813
|
+
let allowed = true;
|
2814
|
+
switch (this.getAllowEvents()) {
|
2815
|
+
case EventsAllowedType.ALL:
|
2816
|
+
allowed = true;
|
2817
|
+
break;
|
2818
|
+
case EventsAllowedType.NONE:
|
2819
|
+
allowed = (act === InternalInterface.MG_ACT_CRELINE);
|
2820
|
+
break;
|
2821
|
+
case EventsAllowedType.NON_INTERACTIVE:
|
2822
|
+
switch (act) {
|
2823
|
+
case InternalInterface.MG_ACT_EXIT_SYSTEM:
|
2824
|
+
case InternalInterface.MG_ACT_EXIT:
|
2825
|
+
case InternalInterface.MG_ACT_CLOSE:
|
2826
|
+
case InternalInterface.MG_ACT_CRELINE:
|
2827
|
+
case InternalInterface.MG_ACT_CRELINE_ABOVE:
|
2828
|
+
case InternalInterface.MG_ACT_ROLLBACK:
|
2829
|
+
allowed = true;
|
2830
|
+
break;
|
2831
|
+
default:
|
2832
|
+
allowed = false;
|
2833
|
+
break;
|
2834
|
+
}
|
2835
|
+
break;
|
2836
|
+
}
|
2837
|
+
return allowed;
|
2838
|
+
}
|
2839
|
+
async commitRecord(task, isReversibleExit) {
|
2840
|
+
let dv = task.DataView;
|
2841
|
+
let rec = dv.getCurrRec();
|
2842
|
+
let forceSuffix = await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
|
2843
|
+
let isSelectionTable = await task.checkProp(PropInterface.PROP_TYPE_SELECTION, false);
|
2844
|
+
let isNewRec = rec.isNewRec();
|
2845
|
+
let savePrevCurrRec = true;
|
2846
|
+
let recModified = rec.Modified;
|
2847
|
+
if (!dv.recInModifiedTab(rec.getId()))
|
2848
|
+
rec.clearFlagsHistory();
|
2849
|
+
await task.TaskTransactionManager.checkAndCommit(isReversibleExit, ConstInterface.TRANS_RECORD_PREFIX, task.ConfirmUpdateNo);
|
2850
|
+
if (task.transactionFailed(ConstInterface.TRANS_RECORD_PREFIX)) {
|
2851
|
+
try {
|
2852
|
+
task.DataSynced = true;
|
2853
|
+
this.setStopExecution(false);
|
2854
|
+
await task.handleEventOnSlaveTasks(InternalInterface.MG_ACT_REC_PREFIX);
|
2855
|
+
}
|
2856
|
+
finally {
|
2857
|
+
this.setStopExecution(true);
|
2858
|
+
}
|
2859
|
+
}
|
2860
|
+
else if (task.isAborting())
|
2861
|
+
this.setStopExecution(true);
|
2862
|
+
else {
|
2863
|
+
if (recModified)
|
2864
|
+
rec.setLateCompute(true);
|
2865
|
+
if (!this._stopExecution)
|
2866
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
2867
|
+
rec.resetUpdated();
|
2868
|
+
rec.resetModified();
|
2869
|
+
if (!recModified && !forceSuffix && (!isSelectionTable || !task.InSelect)) {
|
2870
|
+
if (isNewRec) {
|
2871
|
+
dv.setPrevCurrRec();
|
2872
|
+
savePrevCurrRec = false;
|
2873
|
+
rec.setNewRec();
|
2874
|
+
await task.getForm().cancelEdit(false, false);
|
2875
|
+
await this.HandleStopRowEditing(task);
|
2876
|
+
}
|
2877
|
+
else if (!rec.getForceSaveOrg())
|
2878
|
+
await dv.cancelEdit(EventsManager.REAL_ONLY, true);
|
2879
|
+
else
|
2880
|
+
dv.saveOriginal();
|
2881
|
+
}
|
2882
|
+
else
|
2883
|
+
dv.saveOriginal();
|
2884
|
+
}
|
2885
|
+
if (savePrevCurrRec)
|
2886
|
+
dv.setPrevCurrRec();
|
2887
|
+
}
|
2888
|
+
incLocateTimerCB(taskObj) {
|
2889
|
+
let task = taskObj;
|
2890
|
+
let rtEvt = new RunTimeEvent(task, true);
|
2891
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_INCREMENTAL_LOCATE);
|
2892
|
+
rtEvt.setMainPrgCreator(task);
|
2893
|
+
rtEvt.setCtrl(task.getLastParkedCtrl());
|
2894
|
+
this.addToTail(rtEvt);
|
2895
|
+
}
|
2896
|
+
static async doSyncForSubformParent(task) {
|
2897
|
+
let parentTask = task.getParent();
|
2898
|
+
let parentDv = parentTask.DataView;
|
2899
|
+
let parentRec = parentDv.getCurrRec();
|
2900
|
+
if (task.IsSubForm && parentRec != null && parentRec.Modified && !parentDv.isEmptyDataview()) {
|
2901
|
+
parentRec.setMode(DataModificationTypes.Update);
|
2902
|
+
await parentDv.addCurrToModified(false);
|
2903
|
+
((parentDv.getCurrRec())).Synced = true;
|
2904
|
+
parentDv.setChanged(true);
|
2905
|
+
let dataViewExecuteLocalUpdatesCommand = CommandFactory.CreateDataViewCommand(parentTask.getTaskTag(), DataViewCommandType.ExecuteLocalUpdates);
|
2906
|
+
await parentTask.DataviewManager.Execute(dataViewExecuteLocalUpdatesCommand);
|
2907
|
+
}
|
2908
|
+
}
|
2909
|
+
async ProcessAbortingError(ex) {
|
2910
|
+
let eMsg;
|
2911
|
+
let errForConsole;
|
2912
|
+
let errForMsgBox;
|
2913
|
+
if (ex instanceof ServerError)
|
2914
|
+
eMsg = ex.GetMessage();
|
2915
|
+
else
|
2916
|
+
eMsg = ((ex.Message !== null) ? ex.Message : ex.GetType());
|
2917
|
+
errForConsole = StrUtil.getConsoleErorString(eMsg);
|
2918
|
+
errForMsgBox = StrUtil.getMsgBoxErorString(eMsg);
|
2919
|
+
if (ex.InnerException !== null)
|
2920
|
+
Logger.Instance.WriteExceptionToLog(ex.InnerException, errForConsole);
|
2921
|
+
else {
|
2922
|
+
if (!(ex instanceof ServerError) || Logger.Instance.LogLevel !== Logger_LogLevels.Basic) {
|
2923
|
+
Logger.Instance.WriteExceptionToLogWithMsg(errForConsole);
|
2924
|
+
}
|
2925
|
+
}
|
2926
|
+
let sendUnloadToServer = RuntimeContextBase.Instance.ContextID !== RuntimeContextBase.noContextId;
|
2927
|
+
MGDataCollection.Instance.currMgdID = 0;
|
2928
|
+
let messageString = LanguageData.Instance.getConstMessage(MsgInterface.BRKTAB_STR_ERROR);
|
2929
|
+
let style = 16;
|
2930
|
+
if (ex.Message.startsWith('<HTML')) {
|
2931
|
+
this.processHTMLContent(ex.Message);
|
2932
|
+
}
|
2933
|
+
else {
|
2934
|
+
if (this.ShowErrorInMessageBox(ex)) {
|
2935
|
+
await GUIManager.Instance.MessageBox(messageString, errForMsgBox, style);
|
2936
|
+
}
|
2937
|
+
if (ex instanceof ServerError) {
|
2938
|
+
if (ex.GetCode() == ServerError.ERR_WEBCLIENT_PROGRAM_RELOADED ||
|
2939
|
+
ex.GetCode() == ServerError.ERR_EXECUTED_PROGRAM_CHANGED) {
|
2940
|
+
Commands.addGlobalCommand(CommandType.RELOAD_PAGE);
|
2941
|
+
Commands.beginInvoke();
|
2942
|
+
}
|
2943
|
+
}
|
2944
|
+
}
|
2945
|
+
if (ex instanceof ServerError) {
|
2946
|
+
if (ex.GetCode() === ServerError.ERR_CTX_NOT_FOUND ||
|
2947
|
+
ex.GetCode() === ServerError.ERR_WEBCLIENT_PROGRAM_RELOADED ||
|
2948
|
+
ex.GetCode() === ServerError.ERR_EXECUTED_PROGRAM_CHANGED) {
|
2949
|
+
sendUnloadToServer = false;
|
2950
|
+
}
|
2951
|
+
}
|
2952
|
+
if (sendUnloadToServer) {
|
2953
|
+
try {
|
2954
|
+
let cmd = CommandFactory.CreateUnloadCommand();
|
2955
|
+
MGDataCollection.Instance.getMGData(0).CmdsToServer.Add(cmd);
|
2956
|
+
await CommandsProcessorManager.GetCommandsProcessor().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
2957
|
+
}
|
2958
|
+
catch (ex3) {
|
2959
|
+
if (ex3 instanceof ApplicationException) {
|
2960
|
+
Logger.Instance.WriteExceptionToLog(ex3);
|
2961
|
+
}
|
2962
|
+
else
|
2963
|
+
throw ex3;
|
2964
|
+
}
|
2965
|
+
}
|
2966
|
+
GUIManager.Instance.abort();
|
2967
|
+
}
|
2968
|
+
processHTMLContent(htmlContent) {
|
2969
|
+
Commands.addShowHTMLError(CommandType.SHOW_HTML_ERROR, htmlContent);
|
2970
|
+
Commands.beginInvoke();
|
2971
|
+
}
|
2972
|
+
ShowErrorInMessageBox(ex) {
|
2973
|
+
if (!(ex instanceof ServerError))
|
2974
|
+
return true;
|
2975
|
+
if ((ex.GetCode() == ServerError.ERR_EXECUTED_PROGRAM_CHANGED ||
|
2976
|
+
ex.GetCode() == ServerError.ERR_WEBCLIENT_PROGRAM_RELOADED) &&
|
2977
|
+
RuntimeContextBase.Instance.ContextID === RuntimeContextBase.noContextId)
|
2978
|
+
return false;
|
2979
|
+
return true;
|
2980
|
+
}
|
2981
|
+
getIsInViewRefresh() {
|
2982
|
+
return this.isInViewRefresh;
|
2983
|
+
}
|
2984
|
+
setIsInViewRefresh(inViewRefresh) {
|
2985
|
+
this.isInViewRefresh = inViewRefresh;
|
2986
|
+
}
|
2987
|
+
}
|
2988
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXZlbnRzTWFuYWdlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvZXZlbnQvRXZlbnRzTWFuYWdlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsU0FBUyxFQUNULFNBQVMsRUFDVCxpQkFBaUIsRUFDakIsTUFBTSxFQUNOLGdCQUFnQixFQUNoQixhQUFhLEVBQ2IsSUFBSSxFQUNKLFlBQVksRUFDWixRQUFRLEVBQ1IsT0FBTyxFQUNQL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IGFyZSBpbiBUYXNrIFByZWZpeCwgZG9udCBjaGVjayBlbmRUYXNrIGNvbmRpdGlvbiBoZXJlLlxyXG4gICAgICAgICAgICBpZiAocnRFdnQuZ2V0SW50ZXJuYWxDb2RlKCkgIT09IEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9UQVNLX1BSRUZJWCAmJiB0YXNrLmlzU3RhcnRlZCgpICYmIHRhc2suZ2V0RXhlY0VuZFRhc2soKSkge1xyXG4gICAgICAgICAgICAgIGVuZFRhc2tFcnJvciA9IGF3YWl0IHRhc2suZW5kVGFzayh0cnVlLCBmYWxzZSwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgIGlmIChlbmRUYXNrRXJyb3IpXHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgaWYgKHRoaXMuR2V0U3RvcEV4ZWN1dGlvbkZsYWcoKSkge1xyXG4gICAgICAgICAgICAgIGlmIChhd2FpdCB0aGlzLmhhbmRsZVN0b3BFeGVjdXRpb24ocnRFdnQpKVxyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgIH0gZmluYWxseSB7XHJcbiAgICAgICAgICAgIC8vIHJlc3RvcmluZyB0aGUgY29udGV4dFxyXG4gICAgICAgICAgICBoYW5kbGVyLmdldFRhc2soKS5TZXRDb250ZXh0VGFzayhoYW5kbGVyQ29udGV4dFRhc2spO1xyXG4gICAgICAgICAgfVxyXG5cclxuICAgICAgICAgIGlmICghcHJvcGFnYXRlKVxyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBpZiAocnRFdnRDaGFuZ2VkKVxyXG4gICAgICAgICAgICBoYW5kbGVyID0gcG9zLmdldE5leHQocnRFdnQpO1xyXG4gICAgICAgICAgLy8gZ2V0IHRoZSBuZXh0IGhhbmRsZXIgZm9yIHRoZSBjdXJyZW50IGV2ZW50XHJcbiAgICAgICAgICBl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maXJzdFRpbWUpIHtcclxuICAgICAgICAgICAgICAgIGlzU29uU3ViZm9ybSA9IHBhcmVudFRhc2suSXNTdWJGb3JtO1xyXG4gICAgICAgICAgICAgICAgcGFyZW50VGFzay5BY3Rpb25NYW5hZ2VyLmVuYWJsZShJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfWk9PTSwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgcGFyZW50VGFzay5BY3Rpb25NYW5hZ2VyLmVuYWJsZShJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfREVMTElORSwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgcGFyZW50VGFzay5lbmFibGVDcmVhdGVBY3RzKGZhbHNlKTtcclxuICAgICAgICAgICAgICB9IGVsc2VcclxuICAgICAgICAgICAgICAgIGZpcnN0VGltZSA9IGZhbHNlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgaXNTb25TdWJmb3JtID0gdGFzay5Jc1N1YkZvcm07XHJcblxyXG4gICAgICAgICAgZm9yIChwYXJlbnRUYXNrID0gPFRhc2s+dGFzay5nZXRQYXJlbnQoKTsgKHBhcmVudFRhc2sgIT09IG51bGwpICYmIGlzU29uU3ViZm9ybTsgcGFyZW50VGFzayA9IDxUYXNrPnBhcmVudFRhc2suZ2V0UGFyZW50KCkpIHtcclxuICAgICAgICAgICAgaXNTb25TdWJmb3JtID0gcGFyZW50VGFzay5Jc1N1YkZvcm07XHJcbiAgICAgICAgICAgIGlmIChwYXJlbnRUYXNrLmdldEVuYWJsZVpvb21IYW5kbGVyKCkpXHJcbiAgICAgICAgICAgICAgcGFyZW50VGFzay5BY3Rpb25NYW5hZ2VyLmVuYWJsZShJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfWk9PTSwgdHJ1ZSk7XHJcbiAgICAgICAgICAgIGF3YWl0IHBhcmVudFRhc2suc2V0Q3JlYXRlRGVsZXRlQWN0c0VuYWJsZVN0YXRlK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JcblxyXG4gICAgICAgICAgLy8gaWYgdGhlIGZvcm0gY29udGFpbnMgYSB0YWJsZSBhbmQgdGhlIGNvbnRyb2wgd2FzIGluIHRoZSB0YWJsZVxyXG4gICAgICAgICAgLy8gbW92ZSB0byB0aGUgbmV3IHJvd1xyXG4gICAgICAgICAgaWYgKGZvcm0uZ2V0Um93c0luUGFnZSgpID4gSW50MzIuTWluVmFsdWUgJiYgZGlzcGxheUxpbmUgPiBJbnQzMi5NaW5WYWx1ZSkge1xyXG4gICAgICAgICAgICAvLyBlbnN1cmUgYSB2YWxpZCByb3dcclxuICAgICAgICAgICAgd2hpbGUgKCFkdi5yZWNFeGlzdHMoZGlzcGxheUxpbmUpICYmIGRpc3BsYXlMaW5lID4gMCkge1xyXG4gICAgICAgICAgICAgIGRpc3BsYXlMaW5lLS07XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKGRpc3BsYXlMaW5lID49IDApIHtcclxuICAgICAgICAgICAgICBwcmV2UmVjID0gZHYuZ2V0Q3VyclJlYygpO1xyXG4gICAgICAgICAgICAgIGxldCBvbGRUYXNrTW9kZTogc3RyaW5nID0gdGFzay5nZXRNb2RlKCk7XHJcbiAgICAgICAgICAgICAgbGV0IG9sZFJlY0lkOiBudW1iZXIgPSBwcmV2UmVjLmdldElkKCk7XHJcblxyXG4gICAgICAgICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgICAgICBvbGREaXNwbGF5TGluZSA9IGZvcm0uRGlzcGxheUxpbmU7XHJcbiAgICAgICAgICAgICAgICAvLyBvbGREaXNwbGF5TGluZSA9IGZvcm0uZ2V0Q3VyclJvdygpXHJcbiAgICAgICAgICAgICAgICBmb3JtLlByZXZEaXNwbGF5TGluZSA9IG9sZERpc3BsYXlMaW5lO1xyXG4gICAgICAgICAgICAgICAgYXdhaXQgZm9ybS5zZXRDdXJyUm93QnlEaXNwbGF5TGluZShkaXNwbGF5TGluZSwgdHJ1ZSwgZmFsc2UpO1xyXG4gICAgIC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0aGlzLl9zdG9wRXhlY3V0aW9uKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9sZFRhc2tNb2RlID09PSBDb25zdGFudHMuVEFTS19NT0RFX0NSRUFURSAmJiBvbGREaXNwbGF5TGluZSA+IDAgJiZcclxuICAgICAgICAgICAgICAgICAgICAgICFkdi5yZWNFeGlzdHNCeUlkKG9sZFJlY0lkKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgbGV0IHByZXZMaW5lOiBudW1iZXIgPSBmb3JtLmdldFByZXZMaW5lKG9sZERpc3BsYXlMaW5lKTtcclxuICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IGZvcm0ucmVzdG9yZU9sZERpc3BsYXlMaW5lKHByZXZMaW5lKTtcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2VcclxuICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IGZvcm0ucmVzdG9yZU9sZERpc3BsYXlMaW5lKG9sZERpc3BsYXlMaW5lKTtcclxuICAgICAgICAgICAgICAgICAgICBhd2FpdCBmb3JtLlJlZnJlc2hEaXNwbGF5KENvbnN0YW50cy5UQVNLX1JFRlJFU0hfRk9STSk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRTdG9wRXhlY3V0aW9uKGZhbHNlKTtcclxuICAgICAgICAgICAgICAgICAgICBsYXN0Rm9jdXNlZEN0cmwgPSA8TWdDb250cm9sPnRhc2suZ2V0TGFzdFBhcmtlZEN0cmwoKTtcclxuICAgICAgICAgICAgICAgICAgICB0YXNrLmdldExhc3RQYXJrZWRDdHJsKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxhc3RGb2N1c2VkQ3RybCAhPSBudWxsKVxyXG4gICAgICAgICAgICAgICAgICAgICAgYXdhaXQgbGFzdEZvY3VzZWRDdHJsLmludm9rZSgpO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0U3RvcEV4ZWN1dGlvbih0cnVlKTtcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICAgICAgICAgIH0gZWxzZVxyXG4gICAgICAgICAgICAgICAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZURldlRvTG9nKGUuU3RhY2tUcmFjZSk7XHJcbiAgICAgICAgICAgICAgICB9IGVsc2UgdGhyb3cgZTtcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0gZWxzZVxyXG4gICAgICAgICAgICAgIHRocm93IG5ldyBBcHBsaWNhdGlvbkV4Y2VwdGlvbignaW4gRXZlbnRzTWFuYWdlci5jb21tb25IYW5kbGVyQmVmb3JlKCk6IGludmFsaWQgbGluZSBudW1iZXI6ICcgK1xyXG4gICAgICAgICAgICAgICAgZGlzcGxheUxpbmUpO1xyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgaWYgKHJlYyA9PSBudWxsKVxyXG4gICAgICAgICAgICB0aHJvdyBuZXcgQXBwbGljYXRpb25FeGNlcHRpb24oXHJcbiAgICAgICAgICAgICAgJ2luIEV2ZW50c01hbmFnZXIuY29tbW9uSGFuZGxlckJlZm9yZSgpOiBubyBjdXJyZW50IHJlY29yZCBhdmFpbGFibGUgIScpO1xyXG5cclxuICAgICAgICAgIC8vIG9ubHkgZm9yIG5vbiBpbnRlcmFjdGl2ZSB0YXNrcy4gSW5jcmVhc2UgdGhlIHRhc2sncyBjb3VudGVyIGZvciBldmVyeSByZWNvcmQgd2UgcGFzcy5cclxuICAgICAgICAgIC8vIGRvIGl0IGJlZm9yZSB0aGUgZXZhbEVuZENvbmQgc2luY2UgaXQgbWlnaHQgaW5jbHVkZSBjb3VudGVyKDApLlxyXG4gICAgICAgICAgLy8gaW5jcmVhc2Ugb25seSBpZiBnb2luZyBpbnRvIHRoZSByZWMgcHJlZml4LlxyXG4gICAgICAgICAgaWYgKCF0YXNrLklzSW50ZXJhY3RpdmUgJiYgdGFzay5nZXRMZXZlbCgpID09PSBDb25zdGFudHMuVEFTS19MRVZF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pZ2luYWwoKTtcclxuXHJcbiAgICAgICAgICAvLyBkbyBSZWNvcmQgUHJlZml4IGZvciBhbGwgZmF0aGVycyB0aGF0IHRoZWlyIFJlY29yZCBQcmVmaXggaXMgbm90IGRvbmUgZWFybGllclxyXG4gICAgICAgICAgaWYgKHRhc2suSXNTdWJGb3JtICYmIHRhc2suUGVyZm9ybVBhcmVudFJlY29yZFByZWZpeCkge1xyXG4gICAgICAgICAgICBsZXQgcGFyZW50VGFzayA9IHRhc2suZ2V0UGFyZW50KCk7XHJcbiAgICAgICAgICAgIHdoaWxlIChwYXJlbnRUYXNrLklzU3ViRm9ybSkge1xyXG4gICAgICAgICAgICAgIGlmIChwYXJlbnRUYXNrLmdldExldmVsKCkgPT09IENvbnN0YW50cy5UQVNLX0xFVkVMX1RBU0spIHtcclxuICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHBhcmVudFRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SRUNfUFJFRklYKTtcclxuICAgICAgICAgICAgICAgIHBhcmVudFRhc2sgPSBwYXJlbnRUYXNrLmdldFBhcmVudCgpO1xyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuR2V0U3RvcEV4ZWN1dGlvbkZsYWcoKSlcclxuICAgICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgICAgfSBlbHNlXHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG5cclxuICAgICAgICAgIC8vIGhhbmRsZSBzdWItZm9ybXNcclxuICAgICAgICAgIHRhc2suSW5Db21tb25IYW5kbGVyQmVmb3JlUlAgPSB0cnVlO1xyXG4gICAgICAgICAgaWYgKGF3YWl0IHRhc2suQ2hlY2tSZWZyZXNoU3ViVGFza3MoKSlcclxuICAgICAgICAgICAgYXdhaXQgZHYuY29tcHV0ZVN1YkZvcm1zKCk7XHJ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aWZpZWQgfHwgZm9yY2VTdWZmaXgpICYmIHJlYy5nZXRNb2RlKCkgPT09IERhdGFNb2RpZmljYXRpb25UeXBlcy5EZWxldGUgJiZcclxuICAgICAgICAgICAgdGFzay5nZXRNb2RlKCkgPT09IENvbnN0YW50cy5UQVNLX01PREVfREVMRVRFKVxyXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuXHJcbiAgICAgICAgICAvLyB0byBwcmV2ZW50IGRvdWJsZSBzdWZmaXggb24gdGhlIHNhbWUgcmVjb3JkXHJcbiAgICAgICAgICBpZiAodGFzay5nZXRMZXZlbCgpID09PSBDb25zdGFudHMuVEFTS19MRVZFTF9UQVNLKVxyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcblxyXG4gICAgICAgICAgaWYgKHRhc2suZ2V0TGV2ZWwoKSA9PT0gQ29uc3RhbnRzLlRBU0tfTEVWRUxfQ09OVFJPTCkge1xyXG4gICAgICAgICAgICB0YXNrLnNldEluUmVjb3JkU3VmZml4KHRydWUpO1xyXG4gICAgICAgICAgICBhd2FpdCB0aGlzLmhhbmRsZUludGVybmFsRXZlbnRXaXRoTWdDb250cm9sQmFzZSh0YXNrLmdldExhc3RQYXJrZWRDdHJsKCksIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DVFJMX1NVRkZJWCk7XHJcbiAgICAgICAgICAgIHRhc2suc2V0SW5SZWNvcmRTdWZmaXgoZmFsc2UpO1xyXG4gICAgICAgICAgICBpZiAodGhpcy5fc3RvcEV4ZWN1dGlvbilcclxuICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgYXdhaXQgdGFzay5oYW5kbGVFdmVudE9uU2xhdmVUYXNrcyhJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUkVDX1NVRkZJWCk7XHJcbiAgICAgICAgICBpZiAodGhpcy5fc3RvcEV4ZWN1dGlvbilcclxuICAgICAgICAgICAgcmV0dX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k7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgfVxyXG5cclxuICAgICAgICAgIGlmICh0YXNrLmdldE1vZGUoKSAhPT0gQ29uc3RhbnRzLlRBU0tfTU9ERV9ERUxFVEUgJiYgcmVjLk1vZGlmaWVkKSB7XHJcbiAgICAgICAgICAgIGlmICghYXdhaXQgdGhpcy51cGRhdGVDb25maXJtZWQodGFzaykpXHJcbiAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgfVxyXG5cclxuICAgICAgICAgIGxldCBzdG9wRXhlY3V0aW9uOiBib29sZWFuID0gIWF3YWl0IHRoaXMuZXhlY3V0ZUNvbnRyb2xWZXJpZmljYXRpb24odGFzayk7XHJcbiAgICAgICAgICAvLyBkbyBub3QgY29udGludWUgcHJvY2Vzc2luZyBSUyBpZiBDViByZXR1cm5zIGVycm9yXHJcbiAgICAgICAgICBpZiAoc3RvcEV4ZWN1dGlvbilcclxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgIGNhc2UgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX0NUUkxfUFJFRklYOlxyXG4gICAgICAgICAgaWYgKGF3YWl0IHRoaXMuaGFuZGxlQ3RybFByZWZpeChldnQpKVxyXG4gICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAvLyBkaWQgbm90IHN1Y2NlZWQgaW4gZW50ZXJpbmcgdGhlIGN0cmxcclxuICAgICAgICAgICAgZXZ0LkNvbnRyb2wuSW5Db250cm9sID0gZmFsc2U7XHJcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfQ0FOQ0VMOlxyXG4gIC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UNUO1xyXG4gICAgICAgICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgaWYgKGN0cmwuZ2V0Rm9ybSgpLmdldFRhc2soKS5BY3Rpb25NYW5hZ2VyLmlzRW5hYmxlZChJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfWk9PTSkpXHJcbiAgICAgICAgICAgICAgICAgIHB1dEFjdGlvbiA9IEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9aT09NO1xyXG4gICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgaWYgKHB1dEFjdGlvbiAhPT0gSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX05PTkUpXHJcbiAgICAgICAgICAgICAgICB0aGlzLmFkZEludGVybmFsRXZlbnRXaXRoQ3RybEFuZENvZGUoY3RybCwgcHV0QWN0aW9uKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9ERUxMSU5FOlxyXG4gICAgICAgICAgICBpZiAoYXdhaXQgdGhpcy5IYW5kbGVBY3Rpb25EZWxsaW5lKHRhc2ssIGR2LCByZWMsIGZhbHNlKSlcclxuICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgIGNhc2UgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX0NSRUxJTkU6XHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DUkVMSU5FX0FCT1ZFOlxyXG4gICAgICAgICAgICBpZiAodGFzay5EYXRhVmlldy5pc0VtcHR5RGF0YXZpZXcoKSkge1xyXG4gICAgICAgICAgICAgIGF3YWl0IHRoaXMuZ290b0NyZWF0ZU1vZGUodGFzayk7XHJcblxyXG4gICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmICh0YXNrLmdldEluQ3JlYXRlTGluZSgpKVxyXG4gICAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgICAgdGFzay5zZXRJbkNyZWF0ZUxpbmUodHJ1ZSk7XHJcblxyXG4gICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgIGlmICh0YXNrLmdldExldmVsKCkgPT09IENvbnN0YW50cy5UQVNLX0xFVkVMX0NPTlRST0wpIHtcclxuICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhNZ0NvbnRyb2xCYXNlKHRhc2suZ2V0TGFzdFBhcmtlZEN0cmwoKSwgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX0NUUkxfU1VGRklYKTtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLkdldFN0b3BFeGVjdXRpb25GbGFnKCkpXHJcbiAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgIC8vIHZlcmlmeSB0aGF0IHRoZSBjdXJyZW50IHJlY29yZCBpcyBub3QgYWxyZWFkeSBhIG5ldyBvbmVcclxuICAgICAgICAgICAgICBpZiAodGFzay5nZXRNb2RlKCkgPT09IENvbnN0YW50cy5UQVNLX01PREVfQ1JFQVRFICYmIHJlYyAhPSBudWxsICYmICFyZWMuTW9kaWZpZWQpIHtcclxuICAgICAgICAgICAgICAgIGlmIChhd2FpdCB0YXNrLmNoZWNrUHJvcChQcm9wSW50ZXJmYWNlLlBST1BfVFlQRV9GT1JDRV9TVUZGSVgsIGZhbHNlKSkge1xyXG4gICAgICAgICAgICAgICAgICBkb1N1ZmZpeCA9IGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLmhhbmRsZUludGVybmFsRXZlbnRXaXRoVGFzayh0YXNrLCBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUkVDX1NVRkZJWCk7XHJcbiAgICAgICAgICAgICAgICAgIGlmICh0aGlzLkdldFN0b3BFeGVjdXRpb25GbGFnKCkgfHwgdGFzay5pc0Fib3J0aW5nKCkpXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgdGFzay5zZXRMZXZlbChDb25zdGFudHMuVEFTS19MRVZFTF9UQVNLKTtcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JFQ19QUkVGSVgpO1xyXG5cclxuICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLkdldFN0b3BFeGVjdXRpb25GbGFnKCkgJiYgZm9ybSAhPSBudWxsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gRGVmZWN0IDE1MjM1NTogUGFyayBvbiBsYXN0UGFya2VkQ29udHJvbCBpZiBuZXh0U2NyZWVuIGV2ZW50IG9jY3VycyBpZiBhbHJlYWR5IGluIGNyZWF0ZSBtb2RlIGFuZCByZWNvcmQgbm90IG1vZGlmaWVkXHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGxhc3RQYXJrZWRDb250cm9sOiBNZ0NvbnRyb2wgPSA8TWdDb250cm9sPnRhc2suZ2V0TGFzdFBhcmtlZEN0cmwoKTtcclxuICAgICAgICAgICAgICAgICAgICBpZiAobGFzdFBhcmtlZENvbnRyb2wgIT09IG51bGwpXHJcbiAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBsYXN0UGFya2VkQ29udHJvbC5pbnZva2UoKTtcclxuICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIGxldCByZWZEb1N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LCByZWMsIHRydWUpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9FTlRFUl9ST1dfRURJVElORzpcclxuICAgICAgICAgICAgYXdhaXQgdGhpcy5IYW5kbGVBY3RFbnRlclJvd0VkaXRpbmcodGFzayk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgIGNhc2UgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JUX1FVSVQ6XHJcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SVF9RVUlUKTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUlRPX0NSRUFURTpcclxuICAgICAgICAgICAgaWYgKHRhc2suZ2V0TW9kZSgpID09PSBDb25zdGFudHMuVEFTS19NT0RFX0NSRUFURSB8fFxyXG4gICAgICAgICAgICAgIGF3YWl0ICh0YXNrLmdldFByb3AoUHJvcEludGVyZmFjZS5QUk9QX1RZUEVfQUxMT1dfT1BUSU9OKSkuZ2V0VmFsdWVCb29sZWFuKCkpIHtcclxuICAgICAgICAgICAgICBhd2FpdCB0aGlzLmdvdG9DcmVhdGVNb2RlKHRhc2spO1xyXG5cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SVE9fUVVFUlk6XHJcbiAgICAgICAgICAgIGlmICh0YXNrLmdldE1vZGUoKSAhPT0gQ29uc3RhbnRzLlRBU0tfTU9ERV9RVUVSWSAmJlxyXG4gICAgICAgICAgICAgIChhd2FpdCAodGFzay5nZXRQcm9wKFByb3BJbnRlcmZhY2UuUFJPUF9UWVBFX0FMTE9XX09QVElPTikpLmdldFZhbHVlQm9vbGVhbigpKSA9PT0gZmFsc2UpXHJcbiAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGF3YWl0IHRhc2suZW5hYmxlTW9kZXMoKTtcclxuICAgICAgICAgICAgb2xkTW9kZSA9IHRhc2suZ2V0T3JpZ2luYWxUYXNrTW9kZSgpO1xyXG4gICAgICAgICAgICBhd2FpdCB0aGlzLmhhbmRsZUludGVybmFsRXZlbnRXaXRoVGFzayh0YXNrLCBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUkVDX1NVRkZJWCk7XHJcbiAgICAgICAgICAgIGlmICghdGhpcy5HZXRTdG9wRXhlY3V0aW9uRmxhZygpKSB7XHJcbiAgICAgICAgICAgICAgdGFzay5zZXRNb2RlKENvbnN0YW50cy5UQVNLX01PREVfUVVFUlkpO1xyXG4gICAgICAgICAgICAgIGlmIChvbGRNb2RlICE9PSBDb25zdGFudHMuVEFTS19NT0RFX0NSRUFURSkge1xyXG4gICAgICAgICAgICAgICAgYXdhaXQgZHYuY3VyclJlY0NvbXB1dGUodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLmhhbmRsZUludGVybmFsRXZlbnRXaXRoVGFzayh0YXNrLCBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUkVDX1BSRUZJWCk7XHJcbiAgICAgICAgICAgICAgICBpZiAoY3RybCAhPSBudWxsKVxyXG4gICAgICAgICAgICAgICAgICBhd2FpdCBjdHJsLmludm9rZSgpO1xyXG4gICAgICAgICAgICAgICAgYXdhaXQgZm9ybS5SZWZyZXNoRGlzcGxheShDb25zdGFudHMuVEFTS19SRUZSRVNIX0NVUlJfUkVDKTtcclxuICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy8gd2UgYWxyZWFkeSBleGVjdXRlZCByZWNvcmQgc3VmZml4IC0gc28gd2UgbmVlZCB0byBwcmV2ZW50IHRoZSB2aWV3IHJlZnJlc2hcclxuICAgICAgICAgICAgICAgIC8vIGZyb20gZXhlY3V0aW5nIGl0IGFnYWluXHJcbiAgICAgICAgICAgICAgICB0YXNrLnNldFByZXZlbnRSZWNvcmRTdWZmaXgodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICB0YXNrLnNldFByZXZlbnRDb250cm9sQ2hhbmdlKHRydWUpO1xyXG4gICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JUX1JFRlJFU0hfVklFVyk7XHJcbiAgICAgICAgICAgICAgICBpZiAoY3RybCAhPSBudWxsKVxyXG4gICAgICAgICAgICAgICAgICBhd2FpdCBjdHJsLmludm9rZSgpO1xyXG4gICAgICAgICAgICAgICAgdGFzay5zZXRQcmV2ZW50UmVjb3JkU3VmZml4KGZhbHNlKTtcclxuICAgICAgICAgICAgICAgIHRhc2suc2V0UHJldmVudENvbnRyb2xDaGFuZ2UoZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgaWYgKCFkdi5pc0VtcHR5KCkgJiYgKGR2LmdldEN1cnJSZWMoKSkuZ2V0TW9kZSgpICE9PSBEYXRhTW9kaWZpY2F0aW9uVHlwZXMuSW5zZXJ0KVxyXG4gICAgICAgICAgICAgICAgICB0YXNrLnNldE1vZGUoQ29uc3RhbnRzLlRBU0tfTU9ERV9RVUVSWSk7XHJcbiAgICAgICAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgICAgICAgIHRhc2suc2V0TW9kZShDb25zdGFudHMuVEFTS19NT0RFX0NSRUFURSk7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCBmb3JtLlJlZnJlc2hEaXNwbGF5KENvbnN0YW50cy5UQVNLX1JFRlJFU0hfQ1VSUl9SRUMpO1xyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICB0YXNrLnNldE9yaWdpbmFsVGFza01vZGUoQ29uc3RhbnRzLlRBU0tfTU9ERV9RVUVSWSk7XHJcbiAgICAgICAgICAgICAgYXdhaXQgdGFzay5zZXRDcmVhdGVEZWxldGVBY3RzRW5hYmxlU3RhdGUoKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SVE9fTU9ESUZZOlxyXG4gICAgICAgICAgICBpZiAodGFzay5nZXRNb2RlKCkgIT09IENvbnN0YW50cy5UQVNLX01PREVfTU9ESUZZICYmXHJcbiAgICAgICAgICAgICAgKGF3YWl0ICh0YXNrLmdldFByb3AoUHJvcEludGVyZmFjZS5QUk9QX1RZUEVfQUxMT1dfT1BUSU9OKSkuZ2V0VmFsdWVCb29sZWFuKCkpID09PSBmYWxzZSlcclxuICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgYXdhaXQgdGFzay5lbmFibGVNb2RlcygpO1xyXG4gICAgICAgICAgICBvbGRNb2RlID0gdGFzay5nZXRPcmlnaW5hbFRhc2tNb2RlKCk7XHJcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SRUNfU1VGRklYKTtcclxuICAgICAgICAgICAgaWYgKCF0aGlzLkdldFN0b3BFeGVjdXRpb25GbGFnKCkpIHtcclxuICAgICAgICAgICAgICB0YXNrLnNldE1vZGUoQ29uc3RhbnRzLlRBU0tfTU9ERV9NT0RJRlkpO1xyXG5cclxuICAgICAgICAgICAgICBpZiAob2xkTW9kZSAhPT0gQ29uc3RhbnRzLlRBU0tfTU9ERV9DUkVBVEUpIHtcclxuICAgICAgICAgICAgICAgIGF3YWl0IGR2LmN1cnJSZWNDb21wdXRlKHRydWUpO1xyXG4gICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JFQ19QUkVGSVgpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGN0cmwgIT0gbnVsbClcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgY3RybC5pbnZva2UoKTtcclxuICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgLy8gd2UgYWxyZWFkeSBleGVjdXRlZCByZWNvcmQgc3VmZml4IC0gc28gd2UgbmVlZCB0byBwcmV2ZW50IHRoZSB2aWV3IHJlZnJlc2hcclxuICAgICAgICAgICAgICAgIC8vIGZyb20gZXhlY3V0aW5nIGl0IGFnYWluXHJcbiAgICAgICAgICAgICAgICB0YXNrLnNldFByZXZlbnRSZWNvcmRTdWZmaXgodHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICB0YXNrLnNldFByZXZlbnRDb250cm9sQ2hhbmdlKHRydWUpO1xyXG4gICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JUX1JFRlJFU0hfVklFVyk7XHJcbiAgICAgICAgICAgICAgICBpZiAoY3RybCAhPSBudWxsKVxyXG4gICAgICAgICAgICAgICAgICBhd2FpdCBjdHJsLmludm9rZSgpO1xyXG4gICAgICAgICAgICAgICAgdGFzay5zZXRQcmV2ZW50UmVjb3JkU3VmZml4KGZhbHNlKTtcclxuICAgICAgICAgICAgICAgIHRhc2suc2V0UHJldmVudENvbnRyb2xDaGFuZ2UoZmFsc2UpO1xyXG4gICAgICAgICAgICAgICAgaWYgKCFkdi5pc0VtcHR5KCkgJiYgKGR2LmdldEN1cnJSZWMoKSkuZ2V0TW9kZSgpICE9PSBEYXRhTW9kaWZpY2F0aW9uVHlwZXMuSW5zZXJ0KVxyXG4gICAgICAgICAgICAgICAgICB0YXNrLnNldE1vZGUoQ29uc3RhbnRzLlRBU0tfTU9ERV9NT0RJRlkpO1xyXG4gICAgICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICAgICAgICB0YXNrLnNldE1vZGUoQ29uc3RhbnRzLlRBU0tfTU9ERV9DUkVBVEUpO1xyXG4gICAgICAgICAgICAgICAgYXdhaXQgZm9ybS5SZWZyZXNoRGlzcGxheShDb25zdGFudHMuVEFTS19SRUZSRVNIX0NVUlJfUkVDKTtcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgdGFzay5zZXRPcmlnaW5hbFRhc2tNb2RlKENvbnN0YW50cy5UQVNLX01PREVfTU9ESUZZKTtcclxuICAgICAgICAgICAgICBhd2FpdCB0YXNrLnNldENyZWF0ZURlbGV0ZUFjdHNFbmFibGVTdGF0ZSgpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgIGNhc2UgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1NFTEVDVDpcclxuICAgICAgICAgICAgLyogcHJlZm9ybSByZWMgc3VmZml4ICovXHJcbiAgICAgICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgICAgdGFzay5JblNlbGVjdCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgYXdhaXQgdGhpcy5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JFQ19TVUZGSVgpO1xyXG4gICAgICAgICAgICB9IGZpbmFsbHkge1xyXG4gICAgICAgICAgICAgIHRhc2suSW5TZWxlY3QgPSBmYWxzZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAoIXRoaXMuX3N0b3BFeGVjdXRpb24pIHtcclxuICAgICAgICAgICAgICAvKiBjbG9zZSB0aGUgc2VsZWN0aW9uIHByb2dyYW0gKi9cclxuICAgICAgICAgICAgIC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KCkgPT09IHRhc2tUYWcpIHtcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgcGFyZW50VGFzay5TdWJmb3JtUmVmcmVzaChzdWJmb3JtVGFzaywgdHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgc3ViZm9ybVRhc2sgPSBwYXJlbnRUYXNrO1xyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9TVUJGT1JNX09QRU46XHJcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuT3BlblN1YmZvcm0odGFzaywgPE1nQ29udHJvbD5ldnQuQ29udHJvbCk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgIGNhc2UgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JUT19TRUFSQ0g6XHJcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SRUNfU1VGRklYKTtcclxuICAgICAgICAgICAgaWYgKCF0aGlzLkdldFN0b3BFeGVjdXRpb25GbGFnKCkpIHtcclxuICAgICAgICAgICAgICBjbWQgPSBDb21tYW5kRmFjdG9yeS5DcmVhdGVFdmVudENvbW1hbmQodGFzay5nZXRUYXNrVGFnKCksIGludEV2dENvZGUpO1xyXG4gICAgICAgICAgICAgIHRhc2suZ2V0VGFza0NhY2hlKCkuY2xlYXJDYWNoZSgpO1xyXG4gICAgICAgICAgICAgIGF3YWl0IHRhc2suRGF0YXZpZXdNYW5hZ2VyLkV4ZWN1dGUoY21kKTtcclxuXHJcbiAgICAgICAgICAgICAgLy8gQWZ0ZXIgdmlldyByZWZyZXNoLCB0aGUg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VVBEQVRFLCBmYWxzZSkpIHtcclxuICAgICAgICAgICAgbGV0IGNvbmZpcm1lZDogYm9vbGVhbiA9IGF3YWl0IEdVSU1hbmFnZXIuSW5zdGFuY2UuY29uZmlybV9ib29sKE1zZ0ludGVyZmFjZS5DT05GSVJNX1NUUl9ERUxFVEUpO1xyXG4gICAgICAgICAgICBpZiAoIWNvbmZpcm1lZCkge1xyXG4gICAgICAgICAgICAgIHJlYy5jbGVhck1vZGUoKTtcclxuICAgICAgICAgICAgICByZWMuc2V0TW9kZShvbGRSZWNNb2RlKTtcclxuICAgICAgICAgICAgICB0YXNrLnNldE1vZGUoQ29uc3RhbnRzLlRBU0tfTU9ERV9NT0RJRlkpO1xyXG4gICAgICAgICAgICAgIGlmIChsYXN0UGFya2VkQ3RybCAhPT0gbnVsbClcclxuICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhNZ0NvbnRyb2xCYXNlKGxhc3RQYXJrZWRDdHJsLCBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfQ1RSTF9QUkVGSVgpO1xyXG5cclxuICAgICAgICAgICAgICBpZiAoc2F2ZUlzUm93RWRpdGluZykge1xyXG4gICAgICAgICAgICAgICAgbGV0IG15Zm9ybTogTWdGb3JtID0gPE1nRm9ybT50YXNrLmdldEZvcm0oKTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IG15Zm9ybS5zdGFydFJvd0VkaXRpbmcobXlmb3JtLkRpc3BsYXlMaW5lKTtcclxuICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgIHJldHVybiB0cnVlO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgfVxyXG5cclxuICAgICAgICBhd2FpdCB0aGlzLmhhbmRsZUludGVybmFsRXZlbnRXaXRoVGFzayh0YXNrLCBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUkVDX1NVRkZJWCk7XHJcbiAgICAg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