@magic-xpa/engine 4.1100.0-dev4110.19 → 4.1100.0-dev4110.190
Sign up to get free protection for your applications and to get access to all the features.
- 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 +399 -0
- package/esm2022/src/CommandsProcessorBase.mjs +56 -0
- package/esm2022/src/CommandsProcessorManager.mjs +26 -0
- package/esm2022/src/CommandsTable.mjs +162 -0
- package/esm2022/src/ConstInterface.mjs +516 -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 +154 -0
- package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
- package/esm2022/src/ServerConfig.mjs +118 -0
- package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
- package/{esm2020 → esm2022}/src/bridge/MagicBridge.mjs +40 -40
- 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/{esm2020 → esm2022}/src/commands/ClientToServer/BrowserEscEventCommand.mjs +23 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
- package/esm2022/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +60 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ColumnSortEventCommand.mjs +26 -26
- package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +260 -0
- package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ComputeEventCommand.mjs +23 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +20 -20
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +19 -19
- 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 +37 -0
- package/esm2022/src/commands/ClientToServer/EventCommand.mjs +40 -0
- package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +67 -0
- package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +22 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
- package/{esm2020 → esm2022}/src/commands/ClientToServer/IndexChangeEventCommand.mjs +21 -21
- package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +23 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +23 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
- package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +40 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SelectProgramCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SubformOpenEventCommand.mjs +21 -21
- package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +30 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +14 -14
- 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 +1 -1
- package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
- package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
- package/esm2022/src/commands/ServerToClient/AddRangeCommand.mjs +62 -0
- package/esm2022/src/commands/ServerToClient/AddSortCommand.mjs +33 -0
- 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/esm2022/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -0
- 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/esm2022/src/data/Key.mjs +88 -0
- package/esm2022/src/data/Record.mjs +866 -0
- package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
- package/esm2022/src/data/RecordsTable.mjs +267 -0
- package/esm2022/src/data/TaskTransactionManager.mjs +103 -0
- package/esm2022/src/data/XMLBasedDcValuesBuilder.mjs +74 -0
- 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 +226 -0
- package/esm2022/src/env/MirrorString.mjs +65 -0
- 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 +2975 -0
- package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
- package/esm2022/src/event/RunTimeEvent.mjs +392 -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/esm2022/src/exp/GlobalParamsTable.mjs +85 -0
- 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 +1181 -0
- package/esm2022/src/http/HttpManager.mjs +97 -0
- package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
- package/esm2022/src/http/client/HttpClientBase.mjs +132 -0
- 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/esm2022/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/RemoteCommandsProcessor.mjs +882 -0
- package/esm2022/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -0
- package/esm2022/src/remote/RemoteDataViewCommandBase.mjs +24 -0
- package/esm2022/src/remote/RemoteDataViewCommandFactory.mjs +61 -0
- 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/esm2022/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +17 -0
- package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
- package/esm2022/src/remote/ResetUserSortRemoteDataviewCommand.mjs +16 -0
- package/esm2022/src/remote/ServerError.mjs +40 -0
- package/esm2022/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +20 -0
- 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/{esm2020 → esm2022}/src/rt/DataviewHeaderBase.mjs +98 -96
- package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
- package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
- package/esm2022/src/rt/DataviewHeadersSaxHandler.mjs +38 -0
- package/esm2022/src/rt/ExecutionStack.mjs +94 -0
- package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
- package/esm2022/src/rt/HandlersTable.mjs +96 -0
- 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/esm2022/src/rt/RecomputeTable.mjs +63 -0
- package/esm2022/src/rt/RemoteDataviewHeader.mjs +108 -0
- 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/esm2022/src/tasks/RemoteTaskService.mjs +45 -0
- package/esm2022/src/tasks/Task.mjs +2497 -0
- package/esm2022/src/tasks/TaskBase.mjs +83 -0
- package/esm2022/src/tasks/TaskServiceBase.mjs +25 -0
- package/esm2022/src/tasks/TasksTable.mjs +80 -0
- package/esm2022/src/tasks/sort/Sort.mjs +5 -0
- package/esm2022/src/tasks/sort/SortCollection.mjs +67 -0
- package/esm2022/src/util/ConstUtils.mjs +14 -0
- package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
- package/esm2022/src/util/HeapSort.mjs +70 -0
- 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/esm2022/src/util/cookie.service.mjs +92 -0
- package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29713 -29693
- 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 +32 -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 +515 -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 +34 -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 +8 -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 +10 -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 +8 -8
- package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +7 -7
- package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +7 -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 +15 -15
- package/src/commands/ClientToServer/EventCommand.d.ts +15 -15
- package/src/commands/ClientToServer/ExecOperCommand.d.ts +23 -23
- package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +8 -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 +8 -8
- package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +10 -10
- package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
- package/src/commands/ClientToServer/RecomputeCommand.d.ts +11 -11
- package/src/commands/ClientToServer/RefreshEventCommand.d.ts +12 -12
- package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +10 -10
- package/src/commands/ClientToServer/RollbackEventCommand.d.ts +14 -14
- package/src/commands/ClientToServer/SelectProgramCommand.d.ts +6 -6
- package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
- package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +9 -9
- package/src/commands/ClientToServer/TransactionCommand.d.ts +12 -12
- package/src/commands/ClientToServer/UnloadCommand.d.ts +7 -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 +3 -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 +156 -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 +204 -204
- package/src/event/IEventsManager.d.ts +77 -77
- package/src/event/RunTimeEvent.d.ts +123 -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 +93 -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/CommandsProcessorManager.mjs +0 -26
- 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/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
- package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
- package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
- package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
- package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
- package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
- package/esm2020/src/commands/ClientToServer/EventCommand.mjs +0 -40
- package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
- package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
- 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/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/AddRangeCommand.mjs +0 -62
- package/esm2020/src/commands/ServerToClient/AddSortCommand.mjs +0 -33
- 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/commands/ServerToClient/XMLBasedCommandBuilder.mjs +0 -132
- 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/Key.mjs +0 -88
- package/esm2020/src/data/Record.mjs +0 -846
- package/esm2020/src/data/RecordsTable.mjs +0 -267
- package/esm2020/src/data/TaskTransactionManager.mjs +0 -103
- package/esm2020/src/data/XMLBasedDcValuesBuilder.mjs +0 -74
- 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/env/MirrorString.mjs +0 -65
- 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 -4212
- package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
- package/esm2020/src/exp/GlobalParamsTable.mjs +0 -85
- 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/HttpClientBase.mjs +0 -132
- 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/AddUserLocateRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/AddUserRangeRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/AddUserSortRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
- package/esm2020/src/remote/RemoteControlItemsRefreshCommand.mjs +0 -25
- package/esm2020/src/remote/RemoteDataViewCommandBase.mjs +0 -24
- package/esm2020/src/remote/RemoteDataViewCommandFactory.mjs +0 -61
- package/esm2020/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +0 -17
- package/esm2020/src/remote/ResetUserSortRemoteDataviewCommand.mjs +0 -16
- package/esm2020/src/remote/ServerError.mjs +0 -40
- package/esm2020/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +0 -20
- 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/DataviewHeaders.mjs +0 -53
- package/esm2020/src/rt/DataviewHeadersSaxHandler.mjs +0 -38
- package/esm2020/src/rt/ExecutionStack.mjs +0 -94
- package/esm2020/src/rt/HandlersTable.mjs +0 -96
- 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/RecomputeTable.mjs +0 -63
- package/esm2020/src/rt/RemoteDataviewHeader.mjs +0 -108
- 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/RemoteTaskService.mjs +0 -45
- package/esm2020/src/tasks/Task.mjs +0 -2495
- package/esm2020/src/tasks/TaskBase.mjs +0 -87
- package/esm2020/src/tasks/TaskServiceBase.mjs +0 -25
- package/esm2020/src/tasks/TasksTable.mjs +0 -80
- package/esm2020/src/tasks/sort/Sort.mjs +0 -7
- package/esm2020/src/tasks/sort/SortCollection.mjs +0 -67
- package/esm2020/src/util/ConstUtils.mjs +0 -14
- package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
- package/esm2020/src/util/HeapSort.mjs +0 -70
- 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/esm2020/src/util/cookie.service.mjs +0 -92
- package/fesm2015/magic-xpa-engine.mjs +0 -30835
- package/fesm2015/magic-xpa-engine.mjs.map +0 -1
- package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -0,0 +1,2975 @@
|
|
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);
|
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) {
|
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
|
+
return;
|
892
|
+
}
|
893
|
+
let prevTask = LastFocusedManager.Instance.getLastFocusedTask();
|
894
|
+
if (ctrl === null || ctrl.Type === MgControlType.CTRL_TYPE_TABLE) {
|
895
|
+
if (prevCtrl === null)
|
896
|
+
await this.HandleNonParkableControls(ctrl.getForm().getTask());
|
897
|
+
return;
|
898
|
+
}
|
899
|
+
let currTask;
|
900
|
+
if ((ctrl.Type === MgControlType.CTRL_TYPE_BUTTON) && ((await (ctrl.getProp(PropInterface.PROP_TYPE_RAISE_AT)).getValueInt()) === RaiseAt.TaskInFocus))
|
901
|
+
currTask = prevTask;
|
902
|
+
else
|
903
|
+
currTask = ctrl.getForm().getTask();
|
904
|
+
let canGotoCtrl = this.canGoToControl(ctrl, onClick);
|
905
|
+
if (canGotoCtrl) {
|
906
|
+
if (this.guiPendingEvent != null)
|
907
|
+
return;
|
908
|
+
let handled = await this.HandleSubformModality(ctrl, prevTask, currTask);
|
909
|
+
if (handled)
|
910
|
+
return;
|
911
|
+
let eventLine = (ctrl.isRepeatable() || ctrl.isRadio()) ? line : Int32.MinValue;
|
912
|
+
let rtEvt = new RunTimeEvent(ctrl, eventLine);
|
913
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_CTRL_PREFIX);
|
914
|
+
await this.handleEvent(rtEvt, false);
|
915
|
+
}
|
916
|
+
else if (prevCtrl !== null) {
|
917
|
+
if (!prevCtrl.isModifiable()) {
|
918
|
+
if (prevCtrl.isChoiceControl())
|
919
|
+
await prevCtrl.restoreOldValue();
|
920
|
+
}
|
921
|
+
else if (!currTask.cancelWasRaised()) {
|
922
|
+
let newVal = Manager.GetCtrlVal(prevCtrl);
|
923
|
+
if (!await prevCtrl.validateAndSetValue(newVal, true))
|
924
|
+
this.setStopExecution(true);
|
925
|
+
}
|
926
|
+
MgControl.ReturnToCtrl = prevCtrl;
|
927
|
+
}
|
928
|
+
else
|
929
|
+
await this.HandleNonParkableControls(ctrl.getForm().getTask());
|
930
|
+
if (!this._stopExecution && MgControl.ReturnToCtrl === ctrl)
|
931
|
+
LastFocusedManager.setLastFocusedControl(ctrl.getForm().getTask(), ctrl);
|
932
|
+
return;
|
933
|
+
}
|
934
|
+
finally {
|
935
|
+
ctrl.setFocusedStopExecution(this._stopExecution);
|
936
|
+
if (this._stopExecution) {
|
937
|
+
{
|
938
|
+
let returnToCtrl = MgControl.ReturnToCtrl;
|
939
|
+
if (returnToCtrl !== null) {
|
940
|
+
MGDataCollection.Instance.currMgdID = returnToCtrl.getForm().getTask().getMgdID();
|
941
|
+
await FocusManager.SetFocus(returnToCtrl, -1);
|
942
|
+
returnToCtrl.getForm().getTask().setLastParkedCtrl(returnToCtrl);
|
943
|
+
}
|
944
|
+
}
|
945
|
+
}
|
946
|
+
}
|
947
|
+
}
|
948
|
+
async HandleSubformModality(ctrl, prevTask, currTask) {
|
949
|
+
let handledSubformModality = false;
|
950
|
+
let length = prevTask.getMGData().getTasksCount();
|
951
|
+
let topTask = prevTask.getMGData().getTask(length - 1);
|
952
|
+
if (currTask == prevTask || prevTask != topTask) {
|
953
|
+
if (topTask != null && prevTask != topTask && topTask.IsSubForm) {
|
954
|
+
let subformCtrl = topTask.getForm().getSubFormCtrl();
|
955
|
+
if (subformCtrl.IsModal())
|
956
|
+
prevTask = topTask;
|
957
|
+
}
|
958
|
+
}
|
959
|
+
if (prevTask != ctrl.getForm().getTask() && prevTask.getIsDestinationCall()) {
|
960
|
+
if (!currTask.isDescendentOf(prevTask)) {
|
961
|
+
let subformCtrl = prevTask.getForm().getSubFormCtrl();
|
962
|
+
if (!subformCtrl.IsModal() && !currTask.getIsDestinationCall())
|
963
|
+
subformCtrl = prevTask.GetSubformModalParentTask();
|
964
|
+
if (subformCtrl != null && (ctrl != subformCtrl) && subformCtrl.IsModal()) {
|
965
|
+
await this.performSubformClose(subformCtrl);
|
966
|
+
if (!this._stopExecution)
|
967
|
+
this.guiPendingEvent = this.getLastRtEvent();
|
968
|
+
handledSubformModality = true;
|
969
|
+
}
|
970
|
+
}
|
971
|
+
}
|
972
|
+
return handledSubformModality;
|
973
|
+
}
|
974
|
+
async handleFocusOnNonMagicControl(ctrl) {
|
975
|
+
try {
|
976
|
+
await EventsManager.Instance.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
|
977
|
+
}
|
978
|
+
finally {
|
979
|
+
ctrl.setFocusedStopExecution(this._stopExecution);
|
980
|
+
if (this._stopExecution) {
|
981
|
+
{
|
982
|
+
let returnToCtrl = MgControl.ReturnToCtrl;
|
983
|
+
if (returnToCtrl !== null) {
|
984
|
+
MGDataCollection.Instance.currMgdID = returnToCtrl.getForm().getTask().getMgdID();
|
985
|
+
await FocusManager.SetFocus(returnToCtrl, -1);
|
986
|
+
returnToCtrl.getForm().getTask().setLastParkedCtrl(returnToCtrl);
|
987
|
+
}
|
988
|
+
}
|
989
|
+
}
|
990
|
+
}
|
991
|
+
}
|
992
|
+
canGoToControl(ctrl, onClick) {
|
993
|
+
if (onClick && (ctrl.Type === MgControlType.CTRL_TYPE_SUBFORM || ctrl.Type === MgControlType.CTRL_TYPE_BROWSER))
|
994
|
+
return false;
|
995
|
+
let canGotoCtrl = true;
|
996
|
+
let currTask = ctrl.getForm().getTask();
|
997
|
+
let lastTask = LastFocusedManager.Instance.getLastFocusedTask();
|
998
|
+
if (!currTask.IsInteractive || (lastTask != null && lastTask.getLastParkedCtrl() != null &&
|
999
|
+
lastTask.cancelWasRaised()))
|
1000
|
+
return false;
|
1001
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_IMAGE && !ctrl.IsRepeatable)
|
1002
|
+
canGotoCtrl = false;
|
1003
|
+
return canGotoCtrl;
|
1004
|
+
}
|
1005
|
+
async handleTimer(evt) {
|
1006
|
+
evt.setType(ConstInterface.EVENT_TYPE_TIMER);
|
1007
|
+
if (evt.isIdleTimer()) {
|
1008
|
+
await this.handleExpressionHandlers();
|
1009
|
+
await this.handleContextInactivityAlert(evt);
|
1010
|
+
}
|
1011
|
+
else {
|
1012
|
+
let mgd = MGDataCollection.Instance.getMGData(evt.getMgdID());
|
1013
|
+
await this.handleEvents(mgd.getTimerHandlers(), evt);
|
1014
|
+
}
|
1015
|
+
}
|
1016
|
+
async handleContextInactivityAlert(evt) {
|
1017
|
+
let timeNow = Misc.getSystemMilliseconds();
|
1018
|
+
let mgd = evt.getTask().getMGData();
|
1019
|
+
let lastRequestTime = RemoteCommandsProcessor.GetInstance().GetLastRequestTime;
|
1020
|
+
let contextInactivityTimeout = Environment.Instance.getContextInactivityTimeout() / 10;
|
1021
|
+
let contextInactivityWarningTime = Environment.Instance.getContextInactivityWarningTime() / 10;
|
1022
|
+
let idleTime = (timeNow - lastRequestTime) / 1000;
|
1023
|
+
if (contextInactivityTimeout == 0 || contextInactivityWarningTime == 0)
|
1024
|
+
return;
|
1025
|
+
if (EventsManager.userGrantedForContextActivity && idleTime >= (contextInactivityTimeout - contextInactivityWarningTime)) {
|
1026
|
+
let userConfirmation = await GUIManager.Instance.MessageBox(this.confirmationDialogTitle, this.confirmationDialogMsg, Styles.MSGBOX_BUTTON_YES_NO);
|
1027
|
+
if (userConfirmation == Styles.MSGBOX_RESULT_YES) {
|
1028
|
+
let cmd = CommandFactory.CreateContextTimeoutResetEventCommand();
|
1029
|
+
mgd.CmdsToServer.Add(cmd);
|
1030
|
+
await RemoteCommandsProcessor.GetInstance().Execute(CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS);
|
1031
|
+
}
|
1032
|
+
else {
|
1033
|
+
EventsManager.userGrantedForContextActivity = false;
|
1034
|
+
}
|
1035
|
+
}
|
1036
|
+
}
|
1037
|
+
async handleExpressionHandlers() {
|
1038
|
+
let rtEvt = new RunTimeEvent(LastFocusedManager.Instance.getLastFocusedTask(), LastFocusedManager.getLastFocusedControl());
|
1039
|
+
rtEvt.setExpression(null);
|
1040
|
+
rtEvt.setMainPrgCreator(rtEvt.getTask());
|
1041
|
+
for (let i = 0; i < MGDataCollection.Instance.getSize(); i++) {
|
1042
|
+
let mgd = MGDataCollection.Instance.getMGData(i);
|
1043
|
+
if (mgd !== null && !mgd.IsAborting)
|
1044
|
+
await this.handleEvents(mgd.getExpHandlers(), rtEvt);
|
1045
|
+
}
|
1046
|
+
}
|
1047
|
+
handleResize(ctrl, rowsInPage) {
|
1048
|
+
ctrl.getForm().setRowsInPage(rowsInPage);
|
1049
|
+
}
|
1050
|
+
async handleRowDataCurPage(table, desiredTopIndex, sendAll, lastFocusedVal) {
|
1051
|
+
let form = table.getForm();
|
1052
|
+
await form.setRowData(desiredTopIndex, sendAll);
|
1053
|
+
}
|
1054
|
+
async handleTransferDataToGui(ctrl) {
|
1055
|
+
let form = ctrl.getForm();
|
1056
|
+
await form.transferDataToGui();
|
1057
|
+
}
|
1058
|
+
async fetchRecordsAheadFromServer(ctrl) {
|
1059
|
+
let form = ctrl.getForm();
|
1060
|
+
await form.FetchRecordsAheadFromServer();
|
1061
|
+
}
|
1062
|
+
handleEnableEvents(evt, enable) {
|
1063
|
+
evt.getTask().ActionManager.enableList(evt.getActEnableList(), enable, true);
|
1064
|
+
}
|
1065
|
+
async handleCtrlPrefix(evt) {
|
1066
|
+
let task = evt.getTask();
|
1067
|
+
let currClickedCtrl = RuntimeContextBase.Instance.CurrentClickedCtrl;
|
1068
|
+
let form = task.getForm();
|
1069
|
+
let displayLine = evt.getDisplayLine();
|
1070
|
+
let ctrl = evt.Control;
|
1071
|
+
if (form.isLineMode()) {
|
1072
|
+
if (displayLine === Int32.MinValue || ctrl.isRadio())
|
1073
|
+
displayLine = form.DisplayLine;
|
1074
|
+
}
|
1075
|
+
else
|
1076
|
+
displayLine = Int32.MinValue;
|
1077
|
+
let lastParkedCtrl = LastFocusedManager.getLastFocusedControl();
|
1078
|
+
if (lastParkedCtrl !== null && lastParkedCtrl.getForm().getTask().getMGData().GetId() === ctrl.getForm().getTask().getMGData().GetId() && lastParkedCtrl.getForm().getTask().getLevel() === Constants.TASK_LEVEL_CONTROL) {
|
1079
|
+
if ((ctrl !== lastParkedCtrl || (ctrl.isRepeatable() && displayLine !== ctrl.getDisplayLine(true))) && !lastParkedCtrl.isInControlSuffix()) {
|
1080
|
+
await this.handleInternalEventWithMgControlBase(lastParkedCtrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
|
1081
|
+
if (this._stopExecution) {
|
1082
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_LIST || ctrl.Type === MgControlType.CTRL_TYPE_RADIO || ctrl.Type === MgControlType.CTRL_TYPE_CHECKBOX || ctrl.isTabControl()) {
|
1083
|
+
ctrl.resetPrevVal();
|
1084
|
+
await ctrl.RefreshDisplay();
|
1085
|
+
}
|
1086
|
+
return false;
|
1087
|
+
}
|
1088
|
+
}
|
1089
|
+
else
|
1090
|
+
return false;
|
1091
|
+
}
|
1092
|
+
if (task.InCtrlPrefix)
|
1093
|
+
return false;
|
1094
|
+
task.InCtrlPrefix = true;
|
1095
|
+
let prevCtrl = lastParkedCtrl;
|
1096
|
+
if (currClickedCtrl !== null && currClickedCtrl.getForm().getTask().getMgdID() === ctrl.getForm().getTask().getMgdID() && ctrl.onDiffForm(currClickedCtrl))
|
1097
|
+
prevCtrl = currClickedCtrl;
|
1098
|
+
if (prevCtrl !== null && ctrl.onDiffForm(prevCtrl)) {
|
1099
|
+
let prevTask = prevCtrl.getForm().getTask();
|
1100
|
+
await prevTask.execSubformRecSuffix(ctrl.getForm().getTask());
|
1101
|
+
if (this._stopExecution) {
|
1102
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_LIST || ctrl.Type === MgControlType.CTRL_TYPE_RADIO || ctrl.Type === MgControlType.CTRL_TYPE_CHECKBOX || ctrl.isTabControl()) {
|
1103
|
+
ctrl.resetPrevVal();
|
1104
|
+
await ctrl.RefreshDisplay();
|
1105
|
+
}
|
1106
|
+
task.InCtrlPrefix = false;
|
1107
|
+
return false;
|
1108
|
+
}
|
1109
|
+
if (ctrl.getForm().getTask().isAborting()) {
|
1110
|
+
task.InCtrlPrefix = false;
|
1111
|
+
return false;
|
1112
|
+
}
|
1113
|
+
await EventsManager.doSyncForSubformParent(task);
|
1114
|
+
}
|
1115
|
+
if (task.DataView.isEmptyDataview())
|
1116
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1117
|
+
else {
|
1118
|
+
task.SubformExecMode = Task_SubformExecModeEnum.SET_FOCUS;
|
1119
|
+
let rtEvt = new RunTimeEvent(ctrl, displayLine);
|
1120
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_REC_PREFIX);
|
1121
|
+
await this.handleEvent(rtEvt, false);
|
1122
|
+
}
|
1123
|
+
if (this.GetStopExecutionFlag()) {
|
1124
|
+
task.InCtrlPrefix = false;
|
1125
|
+
return false;
|
1126
|
+
}
|
1127
|
+
if (!await ctrl.IsParkable() && ctrl !== lastParkedCtrl) {
|
1128
|
+
task.InCtrlPrefix = false;
|
1129
|
+
if (lastParkedCtrl === null || !await lastParkedCtrl.invoke())
|
1130
|
+
await this.HandleNonParkableControls(ctrl.getForm().getTask());
|
1131
|
+
return false;
|
1132
|
+
}
|
1133
|
+
Logger.Instance.WriteSupportToLog(NString.Format('{0} Entering control: control {1}, row {2}', task.GetTaskDetails(), ctrl.Name, displayLine < 0 ? 0 : displayLine), true);
|
1134
|
+
task.setLevel(Constants.TASK_LEVEL_CONTROL);
|
1135
|
+
ctrl.KeyStrokeOn = false;
|
1136
|
+
ctrl.ModifiedByUser = false;
|
1137
|
+
task.setCurrField(ctrl.getField());
|
1138
|
+
if (ctrl.IsRepeatable)
|
1139
|
+
await form.bringRecordToPage();
|
1140
|
+
if (lastParkedCtrl !== ctrl) {
|
1141
|
+
if ((lastParkedCtrl === null && ctrl.getForm().isSubForm()) || (lastParkedCtrl !== null && (ctrl.getForm().isSubForm() || lastParkedCtrl.getForm().isSubForm()))) {
|
1142
|
+
let lastParkedTask = null;
|
1143
|
+
if (lastParkedCtrl !== null)
|
1144
|
+
lastParkedTask = lastParkedCtrl.getForm().getTask();
|
1145
|
+
if (lastParkedTask !== task) {
|
1146
|
+
let firstTime = true;
|
1147
|
+
let isSonSubform;
|
1148
|
+
let parentTask;
|
1149
|
+
if (lastParkedTask !== null) {
|
1150
|
+
isSonSubform = lastParkedTask.IsSubForm;
|
1151
|
+
for (parentTask = lastParkedTask; parentTask !== null && isSonSubform; parentTask = parentTask.getParent()) {
|
1152
|
+
if (!firstTime) {
|
1153
|
+
isSonSubform = parentTask.IsSubForm;
|
1154
|
+
parentTask.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, false);
|
1155
|
+
parentTask.ActionManager.enable(InternalInterface.MG_ACT_DELLINE, false);
|
1156
|
+
parentTask.enableCreateActs(false);
|
1157
|
+
}
|
1158
|
+
else
|
1159
|
+
firstTime = false;
|
1160
|
+
}
|
1161
|
+
}
|
1162
|
+
isSonSubform = task.IsSubForm;
|
1163
|
+
for (parentTask = task.getParent(); (parentTask !== null) && isSonSubform; parentTask = parentTask.getParent()) {
|
1164
|
+
isSonSubform = parentTask.IsSubForm;
|
1165
|
+
if (parentTask.getEnableZoomHandler())
|
1166
|
+
parentTask.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, true);
|
1167
|
+
await parentTask.setCreateDeleteActsEnableState();
|
1168
|
+
}
|
1169
|
+
await task.enableModes();
|
1170
|
+
}
|
1171
|
+
}
|
1172
|
+
}
|
1173
|
+
if (task.getEnableZoomHandler() || ctrl.useZoomHandler())
|
1174
|
+
task.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, true);
|
1175
|
+
if (ctrl.isTextControl() || ctrl.isChoiceControl())
|
1176
|
+
ctrl.SetKeyboardLanguage();
|
1177
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_BUTTON)
|
1178
|
+
task.ActionManager.enable(InternalInterface.MG_ACT_BUTTON, true);
|
1179
|
+
await task.setCreateDeleteActsEnableState();
|
1180
|
+
let field = ctrl.getField();
|
1181
|
+
if (field !== null && field.NullAllowed && ctrl.isModifiable() && ctrl.Type !== MgControlType.CTRL_TYPE_BUTTON)
|
1182
|
+
task.ActionManager.enable(InternalInterface.MG_ACT_RT_EDT_NULL, true);
|
1183
|
+
return true;
|
1184
|
+
}
|
1185
|
+
async commonHandlerBefore(evt) {
|
1186
|
+
let evtSave = evt;
|
1187
|
+
let task = evt.getTask();
|
1188
|
+
let rec = null;
|
1189
|
+
let prevRec = null;
|
1190
|
+
let val;
|
1191
|
+
let oldDisplayLine = Int32.MinValue;
|
1192
|
+
if (this._stopExecution)
|
1193
|
+
return false;
|
1194
|
+
if (task.isAborting())
|
1195
|
+
return false;
|
1196
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_SYSTEM) {
|
1197
|
+
let actId = this.getMatchingAction(evt.getKbdItm());
|
1198
|
+
if (actId !== 0 && evt.Control !== null) {
|
1199
|
+
evt = new RunTimeEvent(evt, evt);
|
1200
|
+
evt.setInternal(actId);
|
1201
|
+
evt.setArgList(null);
|
1202
|
+
let mgControl = evt.Control;
|
1203
|
+
evtSave.setCtrl(mgControl);
|
1204
|
+
if (mgControl === null)
|
1205
|
+
return false;
|
1206
|
+
}
|
1207
|
+
}
|
1208
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
|
1209
|
+
let form = task.getForm();
|
1210
|
+
let displayLine = evt.getDisplayLine();
|
1211
|
+
let dv = task.DataView;
|
1212
|
+
rec = dv.getCurrRec();
|
1213
|
+
let ctrl = evt.Control;
|
1214
|
+
let intEvtCode = evt.getInternalCode();
|
1215
|
+
let lastFocusedCtrl = LastFocusedManager.getLastFocusedControl();
|
1216
|
+
switch (intEvtCode) {
|
1217
|
+
case InternalInterface.MG_ACT_ZOOM:
|
1218
|
+
let boolval = await this.selectProg(ctrl);
|
1219
|
+
if (boolval)
|
1220
|
+
return false;
|
1221
|
+
case InternalInterface.MG_ACT_WEB_ON_DBLICK:
|
1222
|
+
break;
|
1223
|
+
case InternalInterface.MG_ACT_CTRL_FOCUS:
|
1224
|
+
await this.handleFocus(ctrl, displayLine, evt.isProduceClick());
|
1225
|
+
return false;
|
1226
|
+
case InternalInterface.MG_ACT_CTRL_FOCUS_ON_NON_MAGIC_CONTROL:
|
1227
|
+
await this.handleFocusOnNonMagicControl(ctrl);
|
1228
|
+
return false;
|
1229
|
+
case InternalInterface.MG_ACT_CTRL_KEYDOWN:
|
1230
|
+
await this.handleKeyDown(task, ctrl, evt);
|
1231
|
+
return false;
|
1232
|
+
case InternalInterface.MG_ACT_CTRL_MOUSEUP:
|
1233
|
+
await this.handleMouseUp(ctrl, displayLine, evt.isProduceClick());
|
1234
|
+
return false;
|
1235
|
+
case InternalInterface.MG_ACT_SELECTION:
|
1236
|
+
await this.onActSelection(ctrl, form, evt);
|
1237
|
+
return false;
|
1238
|
+
case InternalInterface.MG_ACT_TIMER:
|
1239
|
+
await this.handleTimer(evt);
|
1240
|
+
return false;
|
1241
|
+
case InternalInterface.MG_ACT_RESIZE:
|
1242
|
+
this.handleResize(ctrl, displayLine);
|
1243
|
+
return false;
|
1244
|
+
case InternalInterface.MG_ACT_ROW_DATA_CURR_PAGE:
|
1245
|
+
await this.handleRowDataCurPage(ctrl, displayLine, evt.isSendAll(), evt.LastFocusedVal);
|
1246
|
+
return false;
|
1247
|
+
case InternalInterface.MG_ACT_DV_TO_GUI:
|
1248
|
+
await this.handleTransferDataToGui(ctrl);
|
1249
|
+
return false;
|
1250
|
+
case InternalInterface.MG_ACT_FETCH_RECORDS_AHEAD_FROM_SERVER:
|
1251
|
+
await this.fetchRecordsAheadFromServer(ctrl);
|
1252
|
+
break;
|
1253
|
+
case InternalInterface.MG_ACT_ENABLE_EVENTS:
|
1254
|
+
this.handleEnableEvents(evt, true);
|
1255
|
+
return false;
|
1256
|
+
case InternalInterface.MG_ACT_DISABLE_EVENTS:
|
1257
|
+
this.handleEnableEvents(evt, false);
|
1258
|
+
return false;
|
1259
|
+
case InternalInterface.MG_ACT_TASK_PREFIX:
|
1260
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
1261
|
+
break;
|
1262
|
+
case InternalInterface.MG_ACT_TASK_SUFFIX:
|
1263
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
1264
|
+
break;
|
1265
|
+
case InternalInterface.MG_ACT_REC_PREFIX:
|
1266
|
+
if (task.IsSubForm && task.getParent().InCommonHandlerBeforeRP)
|
1267
|
+
return false;
|
1268
|
+
task.setAfterRetry(ConstInterface.RECOVERY_NONE);
|
1269
|
+
task.DataSynced = false;
|
1270
|
+
if (!task.isStarted())
|
1271
|
+
return false;
|
1272
|
+
if (form.getRowsInPage() > Int32.MinValue && displayLine > Int32.MinValue) {
|
1273
|
+
while (!dv.recExists(displayLine) && displayLine > 0) {
|
1274
|
+
displayLine--;
|
1275
|
+
}
|
1276
|
+
if (displayLine >= 0) {
|
1277
|
+
prevRec = dv.getCurrRec();
|
1278
|
+
let oldTaskMode = task.getMode();
|
1279
|
+
let oldRecId = prevRec.getId();
|
1280
|
+
try {
|
1281
|
+
oldDisplayLine = form.DisplayLine;
|
1282
|
+
form.PrevDisplayLine = oldDisplayLine;
|
1283
|
+
await form.setCurrRowByDisplayLine(displayLine, true, false);
|
1284
|
+
if (prevRec != null && !dv.recExistsById(prevRec.getId())) {
|
1285
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_TABLE);
|
1286
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
1287
|
+
}
|
1288
|
+
rec = dv.getCurrRec();
|
1289
|
+
}
|
1290
|
+
catch (e) {
|
1291
|
+
if (e instanceof RecordOutOfDataViewException) {
|
1292
|
+
if (this._stopExecution) {
|
1293
|
+
if (oldTaskMode === Constants.TASK_MODE_CREATE && oldDisplayLine > 0 &&
|
1294
|
+
!dv.recExistsById(oldRecId)) {
|
1295
|
+
let prevLine = form.getPrevLine(oldDisplayLine);
|
1296
|
+
await form.restoreOldDisplayLine(prevLine);
|
1297
|
+
}
|
1298
|
+
else
|
1299
|
+
await form.restoreOldDisplayLine(oldDisplayLine);
|
1300
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_FORM);
|
1301
|
+
this.setStopExecution(false);
|
1302
|
+
lastFocusedCtrl = task.getLastParkedCtrl();
|
1303
|
+
task.getLastParkedCtrl();
|
1304
|
+
if (lastFocusedCtrl != null)
|
1305
|
+
await lastFocusedCtrl.invoke();
|
1306
|
+
this.setStopExecution(true);
|
1307
|
+
return false;
|
1308
|
+
}
|
1309
|
+
else
|
1310
|
+
Logger.Instance.WriteDevToLog(e.StackTrace);
|
1311
|
+
}
|
1312
|
+
else
|
1313
|
+
throw e;
|
1314
|
+
}
|
1315
|
+
}
|
1316
|
+
else
|
1317
|
+
throw new ApplicationException('in EventsManager.commonHandlerBefore(): invalid line number: ' +
|
1318
|
+
displayLine);
|
1319
|
+
}
|
1320
|
+
if (rec == null)
|
1321
|
+
throw new ApplicationException('in EventsManager.commonHandlerBefore(): no current record available !');
|
1322
|
+
if (!task.IsInteractive && task.getLevel() === Constants.TASK_LEVEL_TASK)
|
1323
|
+
task.increaseCounter();
|
1324
|
+
if (await task.evalEndCond(ConstInterface.END_COND_EVAL_BEFORE)) {
|
1325
|
+
await task.endTask(true, false, false);
|
1326
|
+
return false;
|
1327
|
+
}
|
1328
|
+
if (form.HasTable())
|
1329
|
+
await form.bringRecordToPage();
|
1330
|
+
if (task.getLevel() !== Constants.TASK_LEVEL_TASK)
|
1331
|
+
return false;
|
1332
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
1333
|
+
Logger.Instance.WriteDevToLog('RECORD PREFIX: ' + task.queryTaskPath());
|
1334
|
+
(dv.getCurrRec()).setForceSaveOrg(false);
|
1335
|
+
(dv.getCurrRec()).Synced = false;
|
1336
|
+
dv.saveOriginal();
|
1337
|
+
if (task.IsSubForm && task.PerformParentRecordPrefix) {
|
1338
|
+
let parentTask = task.getParent();
|
1339
|
+
while (parentTask.IsSubForm) {
|
1340
|
+
if (parentTask.getLevel() === Constants.TASK_LEVEL_TASK) {
|
1341
|
+
await this.handleInternalEventWithTask(parentTask, InternalInterface.MG_ACT_REC_PREFIX);
|
1342
|
+
parentTask = parentTask.getParent();
|
1343
|
+
if (this.GetStopExecutionFlag())
|
1344
|
+
break;
|
1345
|
+
}
|
1346
|
+
else
|
1347
|
+
break;
|
1348
|
+
}
|
1349
|
+
}
|
1350
|
+
task.InCommonHandlerBeforeRP = true;
|
1351
|
+
if (await task.CheckRefreshSubTasks())
|
1352
|
+
await dv.computeSubForms();
|
1353
|
+
task.InCommonHandlerBeforeRP = false;
|
1354
|
+
task.setLevel(Constants.TASK_LEVEL_RECORD);
|
1355
|
+
await task.enableRecordActions();
|
1356
|
+
break;
|
1357
|
+
case InternalInterface.MG_ACT_REC_SUFFIX:
|
1358
|
+
let forceSuffix = false;
|
1359
|
+
let isSelectionTable;
|
1360
|
+
task.ConfirmUpdateNo = false;
|
1361
|
+
if (rec == null)
|
1362
|
+
return false;
|
1363
|
+
forceSuffix = await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
|
1364
|
+
if ((rec.Modified || forceSuffix) && rec.getMode() === DataModificationTypes.Delete &&
|
1365
|
+
task.getMode() === Constants.TASK_MODE_DELETE)
|
1366
|
+
return true;
|
1367
|
+
if (task.getLevel() === Constants.TASK_LEVEL_TASK)
|
1368
|
+
return false;
|
1369
|
+
if (task.getLevel() === Constants.TASK_LEVEL_CONTROL) {
|
1370
|
+
task.setInRecordSuffix(true);
|
1371
|
+
await this.handleInternalEventWithMgControlBase(task.getLastParkedCtrl(), InternalInterface.MG_ACT_CTRL_SUFFIX);
|
1372
|
+
task.setInRecordSuffix(false);
|
1373
|
+
if (this._stopExecution)
|
1374
|
+
return false;
|
1375
|
+
}
|
1376
|
+
await task.handleEventOnSlaveTasks(InternalInterface.MG_ACT_REC_SUFFIX);
|
1377
|
+
if (this._stopExecution)
|
1378
|
+
return false;
|
1379
|
+
Logger.Instance.WriteDevToLog('RECORD SUFFIX: ' + task.queryTaskPath());
|
1380
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
1381
|
+
isSelectionTable = await task.checkProp(PropInterface.PROP_TYPE_SELECTION, false);
|
1382
|
+
if (task.getMode() === Constants.TASK_MODE_QUERY && !forceSuffix && !rec.Modified &&
|
1383
|
+
!isSelectionTable)
|
1384
|
+
return false;
|
1385
|
+
if (!rec.Modified && !forceSuffix && (!isSelectionTable || !task.InSelect)) {
|
1386
|
+
if (rec.getMode() === DataModificationTypes.Delete) {
|
1387
|
+
return await this.executeControlVerification(task);
|
1388
|
+
}
|
1389
|
+
return false;
|
1390
|
+
}
|
1391
|
+
if (task.getMode() !== Constants.TASK_MODE_DELETE && rec.Modified) {
|
1392
|
+
if (!await this.updateConfirmed(task))
|
1393
|
+
return false;
|
1394
|
+
}
|
1395
|
+
let stopExecution = !await this.executeControlVerification(task);
|
1396
|
+
if (stopExecution)
|
1397
|
+
return false;
|
1398
|
+
break;
|
1399
|
+
case InternalInterface.MG_ACT_CTRL_PREFIX:
|
1400
|
+
if (await this.handleCtrlPrefix(evt))
|
1401
|
+
return true;
|
1402
|
+
else {
|
1403
|
+
evt.Control.InControl = false;
|
1404
|
+
return false;
|
1405
|
+
}
|
1406
|
+
case InternalInterface.MG_ACT_CANCEL:
|
1407
|
+
Manager.CleanMessagePane(task);
|
1408
|
+
break;
|
1409
|
+
case InternalInterface.MG_ACT_CTRL_SUFFIX:
|
1410
|
+
if (ctrl == null || this.getStopExecutionCtrl() != null)
|
1411
|
+
return false;
|
1412
|
+
if (task.getLevel() !== Constants.TASK_LEVEL_CONTROL)
|
1413
|
+
return false;
|
1414
|
+
if (!ctrl.isSubform()) {
|
1415
|
+
val = Manager.GetCtrlVal(ctrl);
|
1416
|
+
task.CurrentEditingControl = null;
|
1417
|
+
if (!task.cancelWasRaised() &&
|
1418
|
+
(ctrl.Type !== MgControlType.CTRL_TYPE_BROWSER && (!isNullOrUndefined(ctrl._field) && (ctrl._field.getType() === StorageAttribute.DATE || ctrl._field.getType() == StorageAttribute.NUMERIC) || val !== null) && typeof val != 'undefined' &&
|
1419
|
+
!await ctrl.validateAndSetValue(val, true))) {
|
1420
|
+
this.setStopExecution(true);
|
1421
|
+
return false;
|
1422
|
+
}
|
1423
|
+
}
|
1424
|
+
if (!this._stopExecution)
|
1425
|
+
Manager.CleanMessagePane(task);
|
1426
|
+
ctrl.InControl = false;
|
1427
|
+
ctrl.ClipBoardDataExists = false;
|
1428
|
+
ctrl.ValidateControl = true;
|
1429
|
+
ctrl.setInControlSuffix(true);
|
1430
|
+
break;
|
1431
|
+
}
|
1432
|
+
}
|
1433
|
+
return true;
|
1434
|
+
}
|
1435
|
+
async selectProg(ctrl) {
|
1436
|
+
let cmd;
|
1437
|
+
let value;
|
1438
|
+
let mgVal;
|
1439
|
+
let progExecuted = false;
|
1440
|
+
let task = ctrl.getForm().getTask();
|
1441
|
+
if (ctrl.HasSelectProgram()) {
|
1442
|
+
if (ctrl.IsParkable()) {
|
1443
|
+
value = Manager.GetCtrlVal(ctrl);
|
1444
|
+
if (!ctrl.validateAndSetValue(value, false))
|
1445
|
+
this.setStopExecution(true);
|
1446
|
+
else {
|
1447
|
+
let encodedVal = null;
|
1448
|
+
mgVal = await ctrl.getMgValue(value);
|
1449
|
+
var rec = task.DataView.getCurrRec();
|
1450
|
+
encodedVal = rec.getXMLForValue(ctrl.getField().getId(), mgVal);
|
1451
|
+
cmd = CommandFactory.CreateSelectProgramCommand(task.getTaskTag(), null, Int32.MinValue, ctrl.getDitIdx(), encodedVal);
|
1452
|
+
task.getMGData().CmdsToServer.Add(cmd);
|
1453
|
+
let commandsProcessorServer = CommandsProcessorManager.GetCommandsProcessor();
|
1454
|
+
await commandsProcessorServer.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
1455
|
+
progExecuted = true;
|
1456
|
+
}
|
1457
|
+
}
|
1458
|
+
}
|
1459
|
+
return progExecuted;
|
1460
|
+
}
|
1461
|
+
async executeControlVerification(task) {
|
1462
|
+
let table = task.getHandlersTab();
|
1463
|
+
for (let i = 0; i < table.getSize(); i++) {
|
1464
|
+
let handler = table.getHandler(i);
|
1465
|
+
let evt = handler.getEvent();
|
1466
|
+
if (evt.getInternalCode() === InternalInterface.MG_ACT_CTRL_VERIFICATION) {
|
1467
|
+
let control = ((task.getForm() !== null) ? task.getForm().getCtrlByCtrlName(handler.getCtrlName()) : null);
|
1468
|
+
if (!isNullOrUndefined(control)) {
|
1469
|
+
let runTimeEvent = new RunTimeEvent(control);
|
1470
|
+
runTimeEvent.setInternal(InternalInterface.MG_ACT_CTRL_VERIFICATION);
|
1471
|
+
await this.handleEvent(runTimeEvent, false);
|
1472
|
+
if (this._stopExecution) {
|
1473
|
+
LastFocusedManager.setLastFocusedControl(task, control);
|
1474
|
+
this.setStopExecutionCtrl(null);
|
1475
|
+
this.setStopExecutionCtrl(control);
|
1476
|
+
return false;
|
1477
|
+
}
|
1478
|
+
}
|
1479
|
+
}
|
1480
|
+
}
|
1481
|
+
return true;
|
1482
|
+
}
|
1483
|
+
async onActSelection(ctrl, form, evt) {
|
1484
|
+
let displayLine = evt.getDisplayLine();
|
1485
|
+
if (displayLine === Int32.MinValue)
|
1486
|
+
displayLine = form.DisplayLine;
|
1487
|
+
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());
|
1488
|
+
if (simulate)
|
1489
|
+
await this.simulateSelection(ctrl, evt.getValue(), displayLine, evt.isProduceClick());
|
1490
|
+
else
|
1491
|
+
await this.handleSelection(ctrl, displayLine, evt.getValue());
|
1492
|
+
}
|
1493
|
+
async onSubformClose(task, evt) {
|
1494
|
+
if ((evt.getArgList() != null) && (evt.getArgList().getSize() === 1)) {
|
1495
|
+
let subformCtrl = null;
|
1496
|
+
let closingSubformName = await evt.getArgList().getArgValue(0, StorageAttribute.ALPHA, 0);
|
1497
|
+
if (closingSubformName == null)
|
1498
|
+
return;
|
1499
|
+
for (let parentTask = task; parentTask.getForm() != null && parentTask.getMgdID() === task.getMgdID(); parentTask = parentTask.getParent()) {
|
1500
|
+
subformCtrl = parentTask.getForm().getCtrlByName(closingSubformName.trim(), MgControlType.CTRL_TYPE_SUBFORM);
|
1501
|
+
if (subformCtrl != null) {
|
1502
|
+
let subformTask = subformCtrl.getSubformTask();
|
1503
|
+
if (subformTask != null && !subformTask.IsRoute()) {
|
1504
|
+
{
|
1505
|
+
await this.performSubformClose(subformCtrl);
|
1506
|
+
}
|
1507
|
+
break;
|
1508
|
+
}
|
1509
|
+
}
|
1510
|
+
}
|
1511
|
+
}
|
1512
|
+
}
|
1513
|
+
async performSubformClose(subformCtrl) {
|
1514
|
+
let subformTask = subformCtrl.getSubformTask();
|
1515
|
+
let parentTask = subformCtrl.getForm().getTask();
|
1516
|
+
let mgd = subformTask.getMGData();
|
1517
|
+
this.pushNewExecStacks();
|
1518
|
+
await subformTask.endTask(true, false, false, true);
|
1519
|
+
this.popNewExecStacks();
|
1520
|
+
if (!this._stopExecution) {
|
1521
|
+
parentTask.TaskService.RemoveRecomputes(parentTask);
|
1522
|
+
await subformTask.stop();
|
1523
|
+
subformCtrl.resetSubformTask();
|
1524
|
+
await CommandsProcessorManager.GetCommandsProcessor().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
1525
|
+
Commands.addClosesubform(CommandType.CLOSE_SUB_FORM, subformCtrl, subformTask.getTaskTag(), subformCtrl.getName(), subformTask.getForm().buildFormName());
|
1526
|
+
if (subformCtrl.IsModal())
|
1527
|
+
mgd.abort();
|
1528
|
+
}
|
1529
|
+
}
|
1530
|
+
createEventArguments(evt) {
|
1531
|
+
if (evt.getArgList() === null) {
|
1532
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
|
1533
|
+
switch (evt.getInternalCode()) {
|
1534
|
+
default:
|
1535
|
+
break;
|
1536
|
+
}
|
1537
|
+
}
|
1538
|
+
}
|
1539
|
+
}
|
1540
|
+
async DoTaskLevelRecordSuffix(task, refDoSuffix) {
|
1541
|
+
let shouldReturn = false;
|
1542
|
+
if (task.getLevel() === Constants.TASK_LEVEL_RECORD) {
|
1543
|
+
refDoSuffix.value = false;
|
1544
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1545
|
+
if (this.GetStopExecutionFlag())
|
1546
|
+
shouldReturn = true;
|
1547
|
+
}
|
1548
|
+
return shouldReturn;
|
1549
|
+
}
|
1550
|
+
async DoTaskLevelRecordPrefix(task) {
|
1551
|
+
if (!this.GetStopExecutionFlag()) {
|
1552
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1553
|
+
}
|
1554
|
+
}
|
1555
|
+
async commonHandler(evt) {
|
1556
|
+
let task = evt.getTask();
|
1557
|
+
let mgData = task.getMGData();
|
1558
|
+
let form = task.getForm();
|
1559
|
+
let ctrl = evt.Control;
|
1560
|
+
let lastParkedCtrl;
|
1561
|
+
let doSuffix = true;
|
1562
|
+
let oldMode;
|
1563
|
+
let server = Task.CommandsProcessor;
|
1564
|
+
if (this._stopExecution)
|
1565
|
+
return;
|
1566
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_USER)
|
1567
|
+
evt = new RunTimeEvent(evt.getUserEvent(), evt);
|
1568
|
+
try {
|
1569
|
+
this.pushRtEvent(evt);
|
1570
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_SYSTEM) {
|
1571
|
+
let actId = this.getMatchingAction(evt.getKbdItm());
|
1572
|
+
if (actId !== 0) {
|
1573
|
+
evt = new RunTimeEvent(evt, evt);
|
1574
|
+
evt.setInternal(actId);
|
1575
|
+
evt.setArgList(null);
|
1576
|
+
}
|
1577
|
+
}
|
1578
|
+
let cmd;
|
1579
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL && !evt.isImmediate() && this.ActAllowed(evt.getInternalCode()) && !this._processingTopMostEndTask) {
|
1580
|
+
let cmdsToServer = mgData.CmdsToServer;
|
1581
|
+
let dv = task.DataView;
|
1582
|
+
let rec = dv.getCurrRec();
|
1583
|
+
let intEvtCode = evt.getInternalCode();
|
1584
|
+
switch (intEvtCode) {
|
1585
|
+
case InternalInterface.MG_ACT_SUBFORM_CLOSE:
|
1586
|
+
await this.onSubformClose(task, evt);
|
1587
|
+
break;
|
1588
|
+
case InternalInterface.MG_ACT_BUTTON:
|
1589
|
+
case InternalInterface.MG_ACT_CTRL_HIT:
|
1590
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_BUTTON &&
|
1591
|
+
(intEvtCode === InternalInterface.MG_ACT_BUTTON || !evt.isGuiTriggeredEvent() || ctrl.isParkable(true))) {
|
1592
|
+
let aRtEvt = new RunTimeEvent(ctrl);
|
1593
|
+
if (ctrl.getRtEvtTask() != null)
|
1594
|
+
aRtEvt.setTask(ctrl.getRtEvtTask());
|
1595
|
+
if (ConstInterface.EVENT_TYPE_NONE !== aRtEvt.getType()) {
|
1596
|
+
if (ctrl.useZoomHandler()) {
|
1597
|
+
let taskToEnable = aRtEvt.getTask();
|
1598
|
+
if (taskToEnable != null)
|
1599
|
+
taskToEnable.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, true);
|
1600
|
+
}
|
1601
|
+
aRtEvt.setArgList(ctrl.ArgList);
|
1602
|
+
await aRtEvt.setPublicName();
|
1603
|
+
this.addToTail(aRtEvt);
|
1604
|
+
this.checkAndSaveRouteEventIfCtxRemovedFromSrvr(aRtEvt);
|
1605
|
+
}
|
1606
|
+
}
|
1607
|
+
else if (ctrl.Type === MgControlType.CTRL_TYPE_TAB) {
|
1608
|
+
this.addInternalEventWithCtrlAndCode(ctrl, InternalInterface.MG_ACT_ZOOM);
|
1609
|
+
}
|
1610
|
+
else if (ctrl.Type === MgControlType.CTRL_TYPE_RADIO) {
|
1611
|
+
ctrl.setControlToFocus();
|
1612
|
+
}
|
1613
|
+
break;
|
1614
|
+
case InternalInterface.MG_ACT_TOGGLE_INSERT:
|
1615
|
+
RuntimeContextBase.Instance.ToggleInsertMode();
|
1616
|
+
break;
|
1617
|
+
case InternalInterface.MG_ACT_CLOSE:
|
1618
|
+
let rtEvt = new RunTimeEvent(evt, evt);
|
1619
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_EXIT);
|
1620
|
+
this.addToTail(rtEvt);
|
1621
|
+
break;
|
1622
|
+
case InternalInterface.MG_ACT_EXIT:
|
1623
|
+
let taskToEnd = (task.isMainProg() ? MGDataCollection.Instance.StartupMgData.getFirstTask() : task);
|
1624
|
+
await taskToEnd.endTask(evt.reversibleExit(), false, evt.ExitDueToError());
|
1625
|
+
break;
|
1626
|
+
case InternalInterface.MG_ACT_EXIT_SYSTEM:
|
1627
|
+
await MGDataCollection.Instance.StartupMgData.getFirstTask().endTask(evt.reversibleExit(), false, false);
|
1628
|
+
break;
|
1629
|
+
case InternalInterface.MG_ACT_TBL_NXTLINE:
|
1630
|
+
if (form != null)
|
1631
|
+
await form.moveInView(Constants.MOVE_UNIT_ROW, Constants.MOVE_DIRECTION_NEXT);
|
1632
|
+
break;
|
1633
|
+
case InternalInterface.MG_ACT_TBL_PRVLINE:
|
1634
|
+
if (form != null)
|
1635
|
+
await form.moveInView(Constants.MOVE_UNIT_ROW, Constants.MOVE_DIRECTION_PREV);
|
1636
|
+
break;
|
1637
|
+
case InternalInterface.MG_ACT_TBL_NXTPAGE:
|
1638
|
+
if (form != null)
|
1639
|
+
await form.moveInView(Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_NEXT);
|
1640
|
+
break;
|
1641
|
+
case InternalInterface.MG_ACT_TBL_PRVPAGE:
|
1642
|
+
if (form != null)
|
1643
|
+
await form.moveInView(Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_PREV);
|
1644
|
+
break;
|
1645
|
+
case InternalInterface.MG_ACT_TBL_BEGPAGE:
|
1646
|
+
if (form != null)
|
1647
|
+
await form.moveInView(Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_BEGIN);
|
1648
|
+
break;
|
1649
|
+
case InternalInterface.MG_ACT_TBL_ENDPAGE:
|
1650
|
+
if (form != null)
|
1651
|
+
await form.moveInView(Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_END);
|
1652
|
+
break;
|
1653
|
+
case InternalInterface.MG_ACT_TBL_BEGTBL:
|
1654
|
+
lastParkedCtrl = task.getLastParkedCtrl();
|
1655
|
+
if (lastParkedCtrl == null || !lastParkedCtrl.isListBox()) {
|
1656
|
+
if (form != null)
|
1657
|
+
await form.moveInView(Constants.MOVE_UNIT_TABLE, Constants.MOVE_DIRECTION_BEGIN);
|
1658
|
+
}
|
1659
|
+
break;
|
1660
|
+
case InternalInterface.MG_ACT_TBL_ENDTBL:
|
1661
|
+
lastParkedCtrl = task.getLastParkedCtrl();
|
1662
|
+
if (lastParkedCtrl === null || !lastParkedCtrl.isListBox()) {
|
1663
|
+
if (form != null)
|
1664
|
+
await form.moveInView(Constants.MOVE_UNIT_TABLE, Constants.MOVE_DIRECTION_END);
|
1665
|
+
}
|
1666
|
+
break;
|
1667
|
+
case InternalInterface.MG_ACT_WEB_ON_DBLICK:
|
1668
|
+
{
|
1669
|
+
let ctrlType = ctrl.Type;
|
1670
|
+
let putAction = InternalInterface.MG_ACT_NONE;
|
1671
|
+
if (ctrlType !== MgControlType.CTRL_TYPE_TABLE && ctrlType !== MgControlType.CTRL_TYPE_LABEL &&
|
1672
|
+
ctrlType !== MgControlType.CTRL_TYPE_IMAGE) {
|
1673
|
+
if (ctrl.getForm().getTask().ActionManager.isEnabled(InternalInterface.MG_ACT_SELECT))
|
1674
|
+
putAction = InternalInterface.MG_ACT_SELECT;
|
1675
|
+
else {
|
1676
|
+
if (ctrl.getForm().getTask().ActionManager.isEnabled(InternalInterface.MG_ACT_ZOOM))
|
1677
|
+
putAction = InternalInterface.MG_ACT_ZOOM;
|
1678
|
+
}
|
1679
|
+
if (putAction !== InternalInterface.MG_ACT_NONE)
|
1680
|
+
this.addInternalEventWithCtrlAndCode(ctrl, putAction);
|
1681
|
+
}
|
1682
|
+
}
|
1683
|
+
break;
|
1684
|
+
case InternalInterface.MG_ACT_DELLINE:
|
1685
|
+
if (await this.HandleActionDelline(task, dv, rec, false))
|
1686
|
+
return;
|
1687
|
+
break;
|
1688
|
+
case InternalInterface.MG_ACT_CRELINE:
|
1689
|
+
case InternalInterface.MG_ACT_CRELINE_ABOVE:
|
1690
|
+
if (task.DataView.isEmptyDataview()) {
|
1691
|
+
await this.gotoCreateMode(task);
|
1692
|
+
break;
|
1693
|
+
}
|
1694
|
+
if (task.getInCreateLine())
|
1695
|
+
break;
|
1696
|
+
task.setInCreateLine(true);
|
1697
|
+
try {
|
1698
|
+
if (task.getLevel() === Constants.TASK_LEVEL_CONTROL) {
|
1699
|
+
await this.handleInternalEventWithMgControlBase(task.getLastParkedCtrl(), InternalInterface.MG_ACT_CTRL_SUFFIX);
|
1700
|
+
if (this.GetStopExecutionFlag())
|
1701
|
+
return;
|
1702
|
+
}
|
1703
|
+
if (task.getMode() === Constants.TASK_MODE_CREATE && rec != null && !rec.Modified) {
|
1704
|
+
if (await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false)) {
|
1705
|
+
doSuffix = false;
|
1706
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1707
|
+
if (this.GetStopExecutionFlag() || task.isAborting())
|
1708
|
+
return;
|
1709
|
+
}
|
1710
|
+
else {
|
1711
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
1712
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1713
|
+
if (!this.GetStopExecutionFlag() && form != null) {
|
1714
|
+
let lastParkedControl = task.getLastParkedCtrl();
|
1715
|
+
if (lastParkedControl !== null)
|
1716
|
+
await lastParkedControl.invoke();
|
1717
|
+
}
|
1718
|
+
return;
|
1719
|
+
}
|
1720
|
+
}
|
1721
|
+
let refDoSuffix = new RefParam(doSuffix);
|
1722
|
+
if (await this.DoTaskLevelRecordSuffix(task, refDoSuffix))
|
1723
|
+
return;
|
1724
|
+
doSuffix = refDoSuffix.value;
|
1725
|
+
if (form != null) {
|
1726
|
+
if ((task.getMode() !== Constants.TASK_MODE_CREATE) || !task.ConfirmUpdateNo)
|
1727
|
+
await form.addRec(doSuffix, intEvtCode == InternalInterface.MG_ACT_CRELINE_ABOVE ? true : false);
|
1728
|
+
}
|
1729
|
+
await this.DoTaskLevelRecordPrefix(task);
|
1730
|
+
await this.HandleActEnterRowEditing(task);
|
1731
|
+
}
|
1732
|
+
finally {
|
1733
|
+
task.setInCreateLine(false);
|
1734
|
+
}
|
1735
|
+
break;
|
1736
|
+
case InternalInterface.MG_ACT_CANCEL:
|
1737
|
+
await this.HandleActCancel(evt, task, form, ctrl, rec, true);
|
1738
|
+
break;
|
1739
|
+
case InternalInterface.MG_ACT_ENTER_ROW_EDITING:
|
1740
|
+
await this.HandleActEnterRowEditing(task);
|
1741
|
+
break;
|
1742
|
+
case InternalInterface.MG_ACT_RT_QUIT:
|
1743
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_RT_QUIT);
|
1744
|
+
break;
|
1745
|
+
case InternalInterface.MG_ACT_RTO_CREATE:
|
1746
|
+
if (task.getMode() === Constants.TASK_MODE_CREATE ||
|
1747
|
+
await (task.getProp(PropInterface.PROP_TYPE_ALLOW_OPTION)).getValueBoolean()) {
|
1748
|
+
await this.gotoCreateMode(task);
|
1749
|
+
}
|
1750
|
+
break;
|
1751
|
+
case InternalInterface.MG_ACT_RTO_QUERY:
|
1752
|
+
if (task.getMode() !== Constants.TASK_MODE_QUERY &&
|
1753
|
+
(await (task.getProp(PropInterface.PROP_TYPE_ALLOW_OPTION)).getValueBoolean()) === false)
|
1754
|
+
break;
|
1755
|
+
await task.enableModes();
|
1756
|
+
oldMode = task.getOriginalTaskMode();
|
1757
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1758
|
+
if (!this.GetStopExecutionFlag()) {
|
1759
|
+
task.setMode(Constants.TASK_MODE_QUERY);
|
1760
|
+
if (oldMode !== Constants.TASK_MODE_CREATE) {
|
1761
|
+
await dv.currRecCompute(true);
|
1762
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1763
|
+
if (ctrl != null)
|
1764
|
+
await ctrl.invoke();
|
1765
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
1766
|
+
}
|
1767
|
+
else {
|
1768
|
+
task.setPreventRecordSuffix(true);
|
1769
|
+
task.setPreventControlChange(true);
|
1770
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_RT_REFRESH_VIEW);
|
1771
|
+
if (ctrl != null)
|
1772
|
+
await ctrl.invoke();
|
1773
|
+
task.setPreventRecordSuffix(false);
|
1774
|
+
task.setPreventControlChange(false);
|
1775
|
+
if (!dv.isEmpty() && (dv.getCurrRec()).getMode() !== DataModificationTypes.Insert)
|
1776
|
+
task.setMode(Constants.TASK_MODE_QUERY);
|
1777
|
+
else
|
1778
|
+
task.setMode(Constants.TASK_MODE_CREATE);
|
1779
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
1780
|
+
}
|
1781
|
+
task.setOriginalTaskMode(Constants.TASK_MODE_QUERY);
|
1782
|
+
await task.setCreateDeleteActsEnableState();
|
1783
|
+
}
|
1784
|
+
break;
|
1785
|
+
case InternalInterface.MG_ACT_RTO_MODIFY:
|
1786
|
+
if (task.getMode() !== Constants.TASK_MODE_MODIFY &&
|
1787
|
+
(await (task.getProp(PropInterface.PROP_TYPE_ALLOW_OPTION)).getValueBoolean()) === false)
|
1788
|
+
break;
|
1789
|
+
await task.enableModes();
|
1790
|
+
oldMode = task.getOriginalTaskMode();
|
1791
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1792
|
+
if (!this.GetStopExecutionFlag()) {
|
1793
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
1794
|
+
if (oldMode !== Constants.TASK_MODE_CREATE) {
|
1795
|
+
await dv.currRecCompute(true);
|
1796
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1797
|
+
if (ctrl != null)
|
1798
|
+
await ctrl.invoke();
|
1799
|
+
}
|
1800
|
+
else {
|
1801
|
+
task.setPreventRecordSuffix(true);
|
1802
|
+
task.setPreventControlChange(true);
|
1803
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_RT_REFRESH_VIEW);
|
1804
|
+
if (ctrl != null)
|
1805
|
+
await ctrl.invoke();
|
1806
|
+
task.setPreventRecordSuffix(false);
|
1807
|
+
task.setPreventControlChange(false);
|
1808
|
+
if (!dv.isEmpty() && (dv.getCurrRec()).getMode() !== DataModificationTypes.Insert)
|
1809
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
1810
|
+
else
|
1811
|
+
task.setMode(Constants.TASK_MODE_CREATE);
|
1812
|
+
await form.RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
1813
|
+
}
|
1814
|
+
task.setOriginalTaskMode(Constants.TASK_MODE_MODIFY);
|
1815
|
+
await task.setCreateDeleteActsEnableState();
|
1816
|
+
}
|
1817
|
+
break;
|
1818
|
+
case InternalInterface.MG_ACT_SELECT:
|
1819
|
+
try {
|
1820
|
+
task.InSelect = true;
|
1821
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1822
|
+
}
|
1823
|
+
finally {
|
1824
|
+
task.InSelect = false;
|
1825
|
+
}
|
1826
|
+
if (!this._stopExecution) {
|
1827
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_EXIT);
|
1828
|
+
}
|
1829
|
+
break;
|
1830
|
+
case InternalInterface.MG_ACT_SUBFORM_REFRESH:
|
1831
|
+
if ((evt.getArgList() != null) && (evt.getArgList().getSize() === 1)) {
|
1832
|
+
let subformCtrl = null;
|
1833
|
+
let RefreshedSubformName = await evt.getArgList().getArgValue(0, StorageAttribute.ALPHA, 0);
|
1834
|
+
if (RefreshedSubformName == null)
|
1835
|
+
break;
|
1836
|
+
for (let parentTask = task; parentTask.getForm() != null && parentTask.getMgdID() === task.getMgdID(); parentTask = parentTask.getParent()) {
|
1837
|
+
subformCtrl = parentTask.getForm().getCtrlByName(RefreshedSubformName.trim(), MgControlType.CTRL_TYPE_SUBFORM);
|
1838
|
+
if (subformCtrl != null) {
|
1839
|
+
let subformTask = subformCtrl.getSubformTask();
|
1840
|
+
if (subformTask == null) {
|
1841
|
+
if (await (subformCtrl.getProp(PropInterface.PROP_TYPE_SUBFORM_TYPE)).getValueInt() !== SubformType.None)
|
1842
|
+
await this.OpenSubform(parentTask, subformCtrl);
|
1843
|
+
}
|
1844
|
+
else
|
1845
|
+
await parentTask.SubformRefresh(subformTask, true);
|
1846
|
+
break;
|
1847
|
+
}
|
1848
|
+
}
|
1849
|
+
}
|
1850
|
+
else if ((evt.getArgList() != null) && (evt.getArgList().getSize() === 2)) {
|
1851
|
+
let subformTask = task, parentTask;
|
1852
|
+
let taskTag = await evt.getArgList().getArgValue(1, StorageAttribute.NUMERIC, 0);
|
1853
|
+
while (subformTask.IsSubForm) {
|
1854
|
+
parentTask = subformTask.getParent();
|
1855
|
+
if (subformTask.getTaskTag() === taskTag) {
|
1856
|
+
await parentTask.SubformRefresh(subformTask, true);
|
1857
|
+
break;
|
1858
|
+
}
|
1859
|
+
subformTask = parentTask;
|
1860
|
+
}
|
1861
|
+
}
|
1862
|
+
break;
|
1863
|
+
case InternalInterface.MG_ACT_SUBFORM_OPEN:
|
1864
|
+
await this.OpenSubform(task, evt.Control);
|
1865
|
+
break;
|
1866
|
+
case InternalInterface.MG_ACT_RTO_SEARCH:
|
1867
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1868
|
+
if (!this.GetStopExecutionFlag()) {
|
1869
|
+
cmd = CommandFactory.CreateEventCommand(task.getTaskTag(), intEvtCode);
|
1870
|
+
task.getTaskCache().clearCache();
|
1871
|
+
await task.DataviewManager.Execute(cmd);
|
1872
|
+
if (!form.isScreenMode()) {
|
1873
|
+
dv.setTopRecIdx(0);
|
1874
|
+
if (form.HasTable()) {
|
1875
|
+
await form.restoreOldDisplayLine(form.recordIdx2DisplayLine(dv.getCurrRecIdx()));
|
1876
|
+
}
|
1877
|
+
}
|
1878
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1879
|
+
if (ctrl != null)
|
1880
|
+
await ctrl.invoke();
|
1881
|
+
}
|
1882
|
+
break;
|
1883
|
+
case InternalInterface.MG_ACT_RT_REFRESH_SCREEN:
|
1884
|
+
case InternalInterface.MG_ACT_RT_REFRESH_VIEW:
|
1885
|
+
case InternalInterface.MG_ACT_RT_REFRESH_RECORD:
|
1886
|
+
await this.handleRefreshEvents(evt);
|
1887
|
+
break;
|
1888
|
+
case InternalInterface.MG_ACT_ACT_CLOSE_APPL:
|
1889
|
+
cmd =
|
1890
|
+
CommandFactory.CreateEventCommand(MGDataCollection.Instance.StartupMgData.getFirstTask().getTaskTag(), InternalInterface.MG_ACT_BROWSER_ESC);
|
1891
|
+
cmdsToServer.Add(cmd);
|
1892
|
+
await server.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
1893
|
+
break;
|
1894
|
+
case InternalInterface.MG_ACT_CONTEXT_REMOVE:
|
1895
|
+
let currRecord = LastFocusedManager.Instance.getLastFocusedTask().DataView.getCurrRec();
|
1896
|
+
if (ClientManager.TransCacheExists() || (currRecord != null && currRecord.Modified)) {
|
1897
|
+
console.log('Pending transaction/record is modified, discarded \'Context Remove\' event.');
|
1898
|
+
}
|
1899
|
+
else {
|
1900
|
+
if (Environment.Instance.getClientContextInactivityTimeout() > 0) {
|
1901
|
+
await this.ExecuteClientContextInactivityTimer();
|
1902
|
+
}
|
1903
|
+
if (!EventsManager.clientContextInactivityTimerAborted) {
|
1904
|
+
let contextTerminationEventCommand = CommandFactory.CreateContextTerminationEventCommand(MGDataCollection.Instance.StartupMgData.getFirstTask().getTaskTag());
|
1905
|
+
MGDataCollection.Instance.getCurrMGData().CmdsToServer.Add(contextTerminationEventCommand);
|
1906
|
+
RemoteCommandsProcessor.GetInstance().Execute(CommandsProcessorBase_SendingInstruction.ONLY_COMMANDS);
|
1907
|
+
console.log('Removed context from server');
|
1908
|
+
RuntimeContextBase.Instance.RemovingContextFromServer = true;
|
1909
|
+
}
|
1910
|
+
else {
|
1911
|
+
console.log('Discarded \'Context Remove\' event as user event occurred.');
|
1912
|
+
EventsManager.clientContextInactivityTimerAborted = false;
|
1913
|
+
break;
|
1914
|
+
}
|
1915
|
+
}
|
1916
|
+
break;
|
1917
|
+
case InternalInterface.MG_ACT_SERVER_TERMINATION:
|
1918
|
+
case InternalInterface.MG_ACT_DUMP_ENVIRONMENT:
|
1919
|
+
cmd = CommandFactory.CreateEventCommand(task.getTaskTag(), intEvtCode);
|
1920
|
+
cmdsToServer.Add(cmd);
|
1921
|
+
await CommandsProcessorManager.GetCommandsProcessor().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
1922
|
+
break;
|
1923
|
+
case InternalInterface.MG_ACT_RT_EDT_NULL:
|
1924
|
+
if (this._currField != null && this._currField.NullAllowed) {
|
1925
|
+
await this._currField.setValueAndStartRecompute(this._currField.getMagicDefaultValue(), true, true, true, false);
|
1926
|
+
await this._currField.updateDisplay();
|
1927
|
+
}
|
1928
|
+
break;
|
1929
|
+
case InternalInterface.MG_ACT_ROLLBACK:
|
1930
|
+
await EventsManager.HandleRollbackAction(task, cmdsToServer, RollbackEventCommand_RollbackType.ROLLBACK);
|
1931
|
+
break;
|
1932
|
+
case InternalInterface.MG_ACT_OK:
|
1933
|
+
case InternalInterface.MG_ACT_INDEX_CHANGE:
|
1934
|
+
case InternalInterface.MG_ACT_COL_SORT:
|
1935
|
+
if ((intEvtCode === InternalInterface.MG_ACT_INDEX_CHANGE && task.DataviewManager.HasRemoteData) ||
|
1936
|
+
(intEvtCode === InternalInterface.MG_ACT_COL_SORT && ctrl.getField() != null)) {
|
1937
|
+
let lastFocusedTask = LastFocusedManager.Instance.getLastFocusedTask();
|
1938
|
+
let focusedCtrl = LastFocusedManager.getLastFocusedControl(LastFocusedManager.LastFocusMgdID);
|
1939
|
+
if (focusedCtrl != null)
|
1940
|
+
await this.handleInternalEventWithMgControlBase(focusedCtrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
|
1941
|
+
if (!this.GetStopExecutionFlag())
|
1942
|
+
await task.ExecuteNestedRS(lastFocusedTask);
|
1943
|
+
if (!this.GetStopExecutionFlag() && task.getLevel() !== Constants.TASK_LEVEL_TASK)
|
1944
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
1945
|
+
if (!this.GetStopExecutionFlag()) {
|
1946
|
+
task.getTaskCache().clearCache();
|
1947
|
+
if (intEvtCode === InternalInterface.MG_ACT_INDEX_CHANGE) {
|
1948
|
+
let taskForm = task.getForm();
|
1949
|
+
if (taskForm.HasTable())
|
1950
|
+
form.clearTableColumnSortMark(true);
|
1951
|
+
cmd = await CommandFactory.CreateIndexChangeCommand(task.getTaskTag(), task.DataView.GetCurrentRecId(), evt.getArgList());
|
1952
|
+
}
|
1953
|
+
else {
|
1954
|
+
cmd = CommandFactory.CreateColumnSortCommand(task.getTaskTag(), evt.Direction, ctrl.getDitIdx(), ctrl.getField().getId(), task.DataView.GetCurrentRecId());
|
1955
|
+
}
|
1956
|
+
await task.DataviewManager.Execute(cmd);
|
1957
|
+
dv.setTopRecIdx(0);
|
1958
|
+
await form.restoreOldDisplayLine(0);
|
1959
|
+
if (!(task === LastFocusedManager.Instance.getLastFocusedTask() || !task.pathContains(LastFocusedManager.Instance.getLastFocusedTask()))) {
|
1960
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1961
|
+
if (!this.GetStopExecutionFlag() && !task.getPreventControlChange())
|
1962
|
+
await lastFocusedTask.ExecuteNestedRS(task);
|
1963
|
+
if (!this.GetStopExecutionFlag() && focusedCtrl != null)
|
1964
|
+
await focusedCtrl.invoke();
|
1965
|
+
}
|
1966
|
+
else
|
1967
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
1968
|
+
}
|
1969
|
+
}
|
1970
|
+
break;
|
1971
|
+
case InternalInterface.MG_ACT_COL_CLICK:
|
1972
|
+
if (!this.GetStopExecutionFlag() && evt.isGuiTriggeredEvent() && ctrl.isColumnSortable()) {
|
1973
|
+
let columnChildControl = ctrl.getColumnChildControl();
|
1974
|
+
if (columnChildControl != null) {
|
1975
|
+
let aRtEvt = new RunTimeEvent(columnChildControl, evt.Direction, 0);
|
1976
|
+
aRtEvt.setInternal(InternalInterface.MG_ACT_COL_SORT);
|
1977
|
+
this.addToTail(aRtEvt);
|
1978
|
+
}
|
1979
|
+
}
|
1980
|
+
break;
|
1981
|
+
}
|
1982
|
+
}
|
1983
|
+
}
|
1984
|
+
finally {
|
1985
|
+
this.popRtEvent();
|
1986
|
+
}
|
1987
|
+
}
|
1988
|
+
async HandleActEnterRowEditing(task) {
|
1989
|
+
if (task.getMode() === Constants.TASK_MODE_QUERY)
|
1990
|
+
task.WriteToMessagePane(`Cannot enter Row Editing when in Query Mode.`);
|
1991
|
+
else {
|
1992
|
+
let myform = task.getForm();
|
1993
|
+
await myform.startRowEditing(myform.DisplayLine);
|
1994
|
+
}
|
1995
|
+
}
|
1996
|
+
async HandleStopRowEditing(task) {
|
1997
|
+
let myform = task.getForm();
|
1998
|
+
await myform.stopRowEditing(myform.DisplayLine);
|
1999
|
+
}
|
2000
|
+
async OpenSubform(task, subformControl) {
|
2001
|
+
task.TaskService.RemoveRecomputes(task);
|
2002
|
+
let cmd = CommandFactory.CreateSubformOpenCommand(task.getTaskTag(), subformControl.getDitIdx());
|
2003
|
+
task.getMGData().CmdsToServer.Add(cmd);
|
2004
|
+
await Task.CommandsProcessor.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
2005
|
+
}
|
2006
|
+
static async HandleRollbackAction(task, cmdsToServer, rollbackType) {
|
2007
|
+
let commandsProcessor = Task.CommandsProcessor;
|
2008
|
+
ClientRefreshCommand.ClientIsInRollbackCommand = true;
|
2009
|
+
task = task.TaskService.GetOwnerTransactionTask(task);
|
2010
|
+
let cmd = CommandFactory.CreateRollbackEventCommand(task.getTaskTag(), rollbackType);
|
2011
|
+
cmdsToServer.Add(cmd);
|
2012
|
+
await commandsProcessor.Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
2013
|
+
ClientRefreshCommand.ClientIsInRollbackCommand = false;
|
2014
|
+
}
|
2015
|
+
async HandleActCancel(evt, task, form, ctrl, rec, isMG_ACT_CANCEL) {
|
2016
|
+
if (task.InHandleActCancel)
|
2017
|
+
return;
|
2018
|
+
task.InHandleActCancel = true;
|
2019
|
+
let oldMode = task.getMode();
|
2020
|
+
let saveDisplayLine = task.getForm().DisplayLine;
|
2021
|
+
if (oldMode !== Constants.TASK_MODE_QUERY && !rec.Updated) {
|
2022
|
+
if (isMG_ACT_CANCEL) {
|
2023
|
+
if (rec.Modified || (task.getLastParkedCtrl() !== null && task.getLastParkedCtrl().ModifiedByUser)) {
|
2024
|
+
if (await task.checkProp(PropInterface.PROP_TYPE_CONFIRM_CANCEL, false)) {
|
2025
|
+
let confirmed = await GUIManager.Instance.confirm_bool(MsgInterface.CONFIRM_STR_CANCEL);
|
2026
|
+
if (!confirmed) {
|
2027
|
+
task.InHandleActCancel = false;
|
2028
|
+
return;
|
2029
|
+
}
|
2030
|
+
}
|
2031
|
+
}
|
2032
|
+
}
|
2033
|
+
let oldRecMode = rec.getMode();
|
2034
|
+
if (GuiEnvironment.Environment.GetSpecialCancelOnCreate() && task.getMode() == Constants.TASK_MODE_CREATE
|
2035
|
+
&& task.getOriginalTaskMode() == Constants.TASK_MODE_CREATE) {
|
2036
|
+
let enable = await task.checkProp(PropInterface.PROP_TYPE_ALLOW_MODIFY, true);
|
2037
|
+
if (enable) {
|
2038
|
+
let allowEmptyDataView = await task.checkProp(PropInterface.PROP_TYPE_ALLOW_EMPTY_DATAVIEW, true);
|
2039
|
+
if (task.DataView.getSize() == 1 && allowEmptyDataView) {
|
2040
|
+
task.setMode('M');
|
2041
|
+
task.DataView.setEmptyDataview(true);
|
2042
|
+
}
|
2043
|
+
}
|
2044
|
+
}
|
2045
|
+
if (isMG_ACT_CANCEL) {
|
2046
|
+
if (task.isTransactionOnLevel(ConstInterface.TRANS_RECORD_PREFIX) && evt.RollbackInCancel()) {
|
2047
|
+
await EventsManager.HandleRollbackAction(task, task.getMGData().CmdsToServer, RollbackEventCommand_RollbackType.CANCEL);
|
2048
|
+
}
|
2049
|
+
}
|
2050
|
+
await EventsManager.HandleCancelEdit(evt, task, form, rec, oldRecMode);
|
2051
|
+
}
|
2052
|
+
else {
|
2053
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
2054
|
+
let lastFocusedControl = LastFocusedManager.getLastFocusedControl();
|
2055
|
+
if (lastFocusedControl !== null) {
|
2056
|
+
lastFocusedControl.getForm().getTask().setLevel(Constants.TASK_LEVEL_TASK);
|
2057
|
+
}
|
2058
|
+
if (!evt.isQuit()) {
|
2059
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2060
|
+
await this.HandleParkabilityOnRowChange(task);
|
2061
|
+
}
|
2062
|
+
}
|
2063
|
+
if (evt.isQuit())
|
2064
|
+
await this.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_EXIT);
|
2065
|
+
await form.stopRowEditing(saveDisplayLine);
|
2066
|
+
task.InHandleActCancel = false;
|
2067
|
+
}
|
2068
|
+
static async HandleCancelEdit(evt, task, form, rec, oldRecMode) {
|
2069
|
+
if (rec.Synced && oldRecMode === DataModificationTypes.Insert)
|
2070
|
+
rec.setMode(oldRecMode);
|
2071
|
+
if (form !== null) {
|
2072
|
+
if (task.getLastParkedCtrl() !== null)
|
2073
|
+
task.getLastParkedCtrl().resetPrevVal();
|
2074
|
+
await form.cancelEdit(true, evt.isQuit());
|
2075
|
+
}
|
2076
|
+
}
|
2077
|
+
async HandleActionDelline(task, dv, rec, nonInteractiveDelete) {
|
2078
|
+
let lastParkedCtrl;
|
2079
|
+
let myform = task.getForm();
|
2080
|
+
let saveIsRowEditing = myform.getIsRowEditingFromGui(myform.DisplayLine);
|
2081
|
+
let oldRecMode;
|
2082
|
+
if (await task.checkProp(PropInterface.PROP_TYPE_ALLOW_DELETE, true)) {
|
2083
|
+
lastParkedCtrl = task.getLastParkedCtrl();
|
2084
|
+
if (lastParkedCtrl !== null)
|
2085
|
+
await this.handleInternalEventWithMgControlBase(lastParkedCtrl, InternalInterface.MG_ACT_CTRL_SUFFIX);
|
2086
|
+
if (!this.GetStopExecutionFlag()) {
|
2087
|
+
oldRecMode = rec.getMode();
|
2088
|
+
rec.clearMode();
|
2089
|
+
rec.setMode(DataModificationTypes.Delete);
|
2090
|
+
if (oldRecMode === DataModificationTypes.Insert)
|
2091
|
+
rec.setSendToServer(false);
|
2092
|
+
if (rec.Modified || await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false)) {
|
2093
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
2094
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
2095
|
+
if (this._stopExecution) {
|
2096
|
+
if (!rec.SendToServer) {
|
2097
|
+
await dv.addCurrToModified();
|
2098
|
+
rec.setSendToServer(true);
|
2099
|
+
}
|
2100
|
+
rec.clearMode();
|
2101
|
+
rec.setMode(oldRecMode);
|
2102
|
+
this.setStopExecution(false);
|
2103
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2104
|
+
this.setStopExecution(true);
|
2105
|
+
return true;
|
2106
|
+
}
|
2107
|
+
}
|
2108
|
+
rec.setInDeleteProcess(true);
|
2109
|
+
task.setMode(Constants.TASK_MODE_DELETE);
|
2110
|
+
let skipConfirmDialog = nonInteractiveDelete;
|
2111
|
+
if (!skipConfirmDialog) {
|
2112
|
+
if (task.mustConfirmInDeleteMode() || await task.checkProp(PropInterface.PROP_TYPE_CONFIRM_UPDATE, false)) {
|
2113
|
+
let confirmed = await GUIManager.Instance.confirm_bool(MsgInterface.CONFIRM_STR_DELETE);
|
2114
|
+
if (!confirmed) {
|
2115
|
+
rec.clearMode();
|
2116
|
+
rec.setMode(oldRecMode);
|
2117
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
2118
|
+
if (lastParkedCtrl !== null)
|
2119
|
+
await this.handleInternalEventWithMgControlBase(lastParkedCtrl, InternalInterface.MG_ACT_CTRL_PREFIX);
|
2120
|
+
if (saveIsRowEditing) {
|
2121
|
+
let myform = task.getForm();
|
2122
|
+
await myform.startRowEditing(myform.DisplayLine);
|
2123
|
+
}
|
2124
|
+
return true;
|
2125
|
+
}
|
2126
|
+
}
|
2127
|
+
}
|
2128
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
2129
|
+
rec.setInDeleteProcess(false);
|
2130
|
+
if (this._stopExecution) {
|
2131
|
+
if (!rec.SendToServer) {
|
2132
|
+
await dv.addCurrToModified();
|
2133
|
+
rec.setSendToServer(true);
|
2134
|
+
}
|
2135
|
+
rec.clearMode();
|
2136
|
+
rec.setMode(oldRecMode);
|
2137
|
+
this.setStopExecution(false);
|
2138
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
2139
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2140
|
+
this.setStopExecution(true);
|
2141
|
+
return true;
|
2142
|
+
}
|
2143
|
+
if (oldRecMode === DataModificationTypes.Insert) {
|
2144
|
+
rec.clearMode();
|
2145
|
+
rec.setMode(oldRecMode);
|
2146
|
+
}
|
2147
|
+
let newCurrRec = dv.getCurrRec();
|
2148
|
+
try {
|
2149
|
+
if (rec !== newCurrRec)
|
2150
|
+
await dv.setCurrRec(rec.getId(), false);
|
2151
|
+
if (!task.isAborting())
|
2152
|
+
await this.delCurrRec(task, false);
|
2153
|
+
}
|
2154
|
+
finally {
|
2155
|
+
if (rec !== newCurrRec) {
|
2156
|
+
await dv.setCurrRec(newCurrRec.getId(), false);
|
2157
|
+
if (dv.getSize() === 1)
|
2158
|
+
task.setMode(Constants.TASK_MODE_CREATE);
|
2159
|
+
}
|
2160
|
+
if (nonInteractiveDelete)
|
2161
|
+
task.setMode(Constants.TASK_MODE_DELETE);
|
2162
|
+
}
|
2163
|
+
}
|
2164
|
+
}
|
2165
|
+
return false;
|
2166
|
+
}
|
2167
|
+
async handleRefreshEvents(evt) {
|
2168
|
+
let task = evt.getTask();
|
2169
|
+
let form = task.getForm();
|
2170
|
+
let dv = task.DataView;
|
2171
|
+
let intEvtCode = evt.getInternalCode();
|
2172
|
+
let cmd = null;
|
2173
|
+
if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_RECORD)
|
2174
|
+
this._isInRecordFlushEvent = true;
|
2175
|
+
if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_VIEW && task.getMode() === Constants.TASK_MODE_CREATE && !await task.checkProp(PropInterface.PROP_TYPE_ALLOW_MODIFY, true)) {
|
2176
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_EXIT);
|
2177
|
+
}
|
2178
|
+
else {
|
2179
|
+
await task.ExecuteNestedRS(LastFocusedManager.Instance.getLastFocusedTask());
|
2180
|
+
if (!this.GetStopExecutionFlag()) {
|
2181
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
2182
|
+
}
|
2183
|
+
if (!this.GetStopExecutionFlag() && !task.InEndTask && !task.isAborting()) {
|
2184
|
+
if (intEvtCode !== InternalInterface.MG_ACT_RT_REFRESH_SCREEN) {
|
2185
|
+
let currentRow = 0;
|
2186
|
+
if (!evt.getRefreshType()) {
|
2187
|
+
if (evt.RtViewRefreshUseCurrentRow() && task.IsInteractive) {
|
2188
|
+
currentRow = form.getCurrRecPosInForm();
|
2189
|
+
}
|
2190
|
+
cmd = CommandFactory.CreateInternalRefreshCommand(task.getTaskTag(), intEvtCode, dv.CurrentRecId, currentRow);
|
2191
|
+
}
|
2192
|
+
else {
|
2193
|
+
if (task.IsInteractive)
|
2194
|
+
currentRow = form.getCurrRecPosInForm();
|
2195
|
+
let refetchRecord = true;
|
2196
|
+
if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_RECORD && evt.getArgList() !== null && evt.getArgList().getSize() !== 0) {
|
2197
|
+
let refetchRecStr;
|
2198
|
+
refetchRecStr = await evt.getArgList().getArgValue(0, StorageAttribute.BOOLEAN, 0);
|
2199
|
+
refetchRecord = (isNullOrUndefined(refetchRecStr) || refetchRecStr === '1');
|
2200
|
+
}
|
2201
|
+
if (refetchRecord)
|
2202
|
+
cmd = await CommandFactory.CreateRealRefreshCommand(task.getTaskTag(), intEvtCode, currentRow, evt.getArgList(), dv.CurrentRecId);
|
2203
|
+
}
|
2204
|
+
}
|
2205
|
+
else {
|
2206
|
+
let id;
|
2207
|
+
if (task.getForm() === null)
|
2208
|
+
id = 0;
|
2209
|
+
else if (task.getForm().isScreenMode())
|
2210
|
+
id = (task.DataView.getCurrRec()).getId();
|
2211
|
+
else
|
2212
|
+
id = task.DataView.getRecByIdx(task.DataView.getTopRecIdx()).getId();
|
2213
|
+
cmd = CommandFactory.CreateScreenRefreshCommand(task.getTaskTag(), id, dv.CurrentRecId);
|
2214
|
+
}
|
2215
|
+
if (intEvtCode !== InternalInterface.MG_ACT_RT_REFRESH_SCREEN)
|
2216
|
+
task.getTaskCache().clearCache();
|
2217
|
+
if (cmd !== null)
|
2218
|
+
await task.DataviewManager.Execute(cmd);
|
2219
|
+
this._isInRecordFlushEvent = false;
|
2220
|
+
if (!this.GetStopExecutionFlag() && !task.InEndTask && !task.isAborting()) {
|
2221
|
+
if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_VIEW && !form.isScreenMode()) {
|
2222
|
+
dv.setTopRecIdx(0);
|
2223
|
+
if (form.HasTable()) {
|
2224
|
+
form.clearTableColumnSortMark(true);
|
2225
|
+
await form.restoreOldDisplayLine(form.recordIdx2DisplayLine(dv.getCurrRecIdx()));
|
2226
|
+
}
|
2227
|
+
}
|
2228
|
+
if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_RECORD && task.getMode() !== Constants.TASK_MODE_QUERY && !task.getAfterRetry()) {
|
2229
|
+
if (task.getMode() === Constants.TASK_MODE_CREATE) {
|
2230
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
2231
|
+
(task.DataView.getCurrRec()).setOldRec();
|
2232
|
+
}
|
2233
|
+
await dv.currRecCompute(true);
|
2234
|
+
}
|
2235
|
+
else if (intEvtCode === InternalInterface.MG_ACT_RT_REFRESH_SCREEN && task.getMode() !== Constants.TASK_MODE_QUERY && !task.getAfterRetry()) {
|
2236
|
+
await dv.currRecCompute(true);
|
2237
|
+
}
|
2238
|
+
this.setIsInViewRefresh(true);
|
2239
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2240
|
+
if (!this.GetStopExecutionFlag() && !task.getPreventControlChange()) {
|
2241
|
+
if (!(task === LastFocusedManager.Instance.getLastFocusedTask() || !task.pathContains(LastFocusedManager.Instance.getLastFocusedTask())))
|
2242
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
2243
|
+
}
|
2244
|
+
}
|
2245
|
+
}
|
2246
|
+
}
|
2247
|
+
}
|
2248
|
+
async gotoCreateMode(task) {
|
2249
|
+
let cmd;
|
2250
|
+
await task.enableModes();
|
2251
|
+
await task.ExecuteNestedRS(LastFocusedManager.Instance.getLastFocusedTask());
|
2252
|
+
if (!this.GetStopExecutionFlag())
|
2253
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_SUFFIX);
|
2254
|
+
if (!this.GetStopExecutionFlag()) {
|
2255
|
+
cmd = CommandFactory.CreateEventCommand(task.getTaskTag(), InternalInterface.MG_ACT_RTO_CREATE);
|
2256
|
+
await task.DataviewManager.Execute(cmd);
|
2257
|
+
if (task.getLevel() === Constants.TASK_LEVEL_TASK)
|
2258
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2259
|
+
await this.HandleNonParkableControls(task);
|
2260
|
+
await task.setCreateDeleteActsEnableState();
|
2261
|
+
task.setOriginalTaskMode(Constants.TASK_MODE_CREATE);
|
2262
|
+
await this.HandleActEnterRowEditing(task);
|
2263
|
+
}
|
2264
|
+
}
|
2265
|
+
async commonHandlerAfter(evt, rcBefore) {
|
2266
|
+
let task = evt.getTask();
|
2267
|
+
let dv;
|
2268
|
+
let rec = null;
|
2269
|
+
let ctrl;
|
2270
|
+
let recModified = false;
|
2271
|
+
let recModeIsDelete = false;
|
2272
|
+
let forceSuffix;
|
2273
|
+
if (this._stopExecution && evt.getInternalCode() !== InternalInterface.MG_ACT_REC_SUFFIX && evt.getInternalCode() !== InternalInterface.MG_ACT_CTRL_SUFFIX)
|
2274
|
+
return;
|
2275
|
+
if (evt.getType() === ConstInterface.EVENT_TYPE_INTERNAL) {
|
2276
|
+
dv = task.DataView;
|
2277
|
+
rec = dv.getCurrRec();
|
2278
|
+
ctrl = evt.Control;
|
2279
|
+
switch (evt.getInternalCode()) {
|
2280
|
+
case InternalInterface.MG_ACT_REC_PREFIX:
|
2281
|
+
if (rcBefore) {
|
2282
|
+
if (await task.CheckRefreshSubTasks())
|
2283
|
+
await task.doSubformRecPrefixSuffix();
|
2284
|
+
await task.handleEventOnSlaveTasks(InternalInterface.MG_ACT_REC_PREFIX);
|
2285
|
+
await task.enableModes();
|
2286
|
+
}
|
2287
|
+
break;
|
2288
|
+
case InternalInterface.MG_ACT_REC_SUFFIX:
|
2289
|
+
task.isFirstRecordCycle(false);
|
2290
|
+
if (task.getPreventRecordSuffix()) {
|
2291
|
+
task.setPreventRecordSuffix(false);
|
2292
|
+
return;
|
2293
|
+
}
|
2294
|
+
task.DoSubformPrefixSuffix = false;
|
2295
|
+
if (this._stopExecution) {
|
2296
|
+
if (rec.getMode() === DataModificationTypes.Delete)
|
2297
|
+
rec.clearMode();
|
2298
|
+
if (task.getLevel() !== Constants.TASK_LEVEL_CONTROL) {
|
2299
|
+
let last = this.getStopExecutionCtrl();
|
2300
|
+
if (last === null)
|
2301
|
+
last = task.getLastParkedCtrl();
|
2302
|
+
this.setStopExecution(false);
|
2303
|
+
this.setStopExecutionCtrl(null);
|
2304
|
+
if (last != null) {
|
2305
|
+
task.setLevel(Constants.TASK_LEVEL_RECORD);
|
2306
|
+
let inCtrlPrefix = task.InCtrlPrefix;
|
2307
|
+
task.InCtrlPrefix = false;
|
2308
|
+
await this.handleInternalEventWithMgControlBase(last, InternalInterface.MG_ACT_CTRL_PREFIX);
|
2309
|
+
task.InCtrlPrefix = inCtrlPrefix;
|
2310
|
+
}
|
2311
|
+
this.setStopExecution(true);
|
2312
|
+
}
|
2313
|
+
return;
|
2314
|
+
}
|
2315
|
+
else {
|
2316
|
+
await this.HandleStopRowEditing(task);
|
2317
|
+
}
|
2318
|
+
if (rec != null) {
|
2319
|
+
recModified = rec.Modified;
|
2320
|
+
if (!this._stopExecution && rec.isCauseInvalidation()) {
|
2321
|
+
task.getForm().invalidateTable();
|
2322
|
+
rec.setCauseInvalidation(false);
|
2323
|
+
}
|
2324
|
+
recModeIsDelete = (rec.getMode() === DataModificationTypes.Delete);
|
2325
|
+
forceSuffix = await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
|
2326
|
+
if (recModeIsDelete && task.getMode() === Constants.TASK_MODE_DELETE ||
|
2327
|
+
!recModeIsDelete && !rec.inDeleteProcess() && (recModified || forceSuffix)) {
|
2328
|
+
rec.setMode(DataModificationTypes.Update);
|
2329
|
+
await dv.addCurrToModified();
|
2330
|
+
dv.setChanged(true);
|
2331
|
+
if (recModified && task.getMode() === Constants.TASK_MODE_QUERY) {
|
2332
|
+
if (rec.realModified() &&
|
2333
|
+
!Environment.Instance.allowUpdateInQueryMode(task.getCompIdx())) {
|
2334
|
+
await dv.cancelEdit(EventsManager.REAL_ONLY, false);
|
2335
|
+
task.WriteToMessagePanebyMsgId(MsgInterface.RT_STR_UPDATE_IN_QUERY);
|
2336
|
+
await task.getForm().RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
2337
|
+
}
|
2338
|
+
}
|
2339
|
+
}
|
2340
|
+
if (!this.isForceExitPreRecordUpdate(task) &&
|
2341
|
+
(!task.isAborting() || MGDataCollection.Instance.GetTaskByID(task.getTaskTag()) != null)) {
|
2342
|
+
if ((!recModeIsDelete || task.getMode() === Constants.TASK_MODE_DELETE))
|
2343
|
+
await this.commitRecord(task, evt.reversibleExit());
|
2344
|
+
}
|
2345
|
+
if (!task.transactionFailed(ConstInterface.TRANS_RECORD_PREFIX) && !task.isAborting()) {
|
2346
|
+
if ((rec.getMode() === DataModificationTypes.Delete &&
|
2347
|
+
task.getMode() === Constants.TASK_MODE_DELETE) ||
|
2348
|
+
rec.getMode() !== DataModificationTypes.Delete)
|
2349
|
+
if (await task.evalEndCond(ConstInterface.END_COND_EVAL_AFTER))
|
2350
|
+
await task.endTask(true, false, false);
|
2351
|
+
}
|
2352
|
+
}
|
2353
|
+
break;
|
2354
|
+
case InternalInterface.MG_ACT_CTRL_PREFIX:
|
2355
|
+
if (rcBefore) {
|
2356
|
+
if (await ctrl.IsParkable() || ctrl === LastFocusedManager.getLastFocusedControl()) {
|
2357
|
+
ctrl.InControl = true;
|
2358
|
+
if (ctrl.ShouldRefreshOnControlEnter())
|
2359
|
+
await ctrl.getField().updateDisplay();
|
2360
|
+
task.setLastParkedCtrl(ctrl);
|
2361
|
+
RuntimeContextBase.Instance.CurrentClickedCtrl = null;
|
2362
|
+
await ctrl.SetFocus(ctrl, ctrl.getDisplayLine(false), true);
|
2363
|
+
this.setStopExecutionCtrl(null);
|
2364
|
+
MgControl.ReturnToCtrl = ctrl;
|
2365
|
+
task.InCtrlPrefix = false;
|
2366
|
+
}
|
2367
|
+
else {
|
2368
|
+
task.InCtrlPrefix = false;
|
2369
|
+
await this.HandleNonParkableControls(ctrl.getForm().getTask());
|
2370
|
+
}
|
2371
|
+
}
|
2372
|
+
break;
|
2373
|
+
case InternalInterface.MG_ACT_CTRL_SUFFIX:
|
2374
|
+
if (!this.GetStopExecutionFlag()) {
|
2375
|
+
if (ctrl.isChoiceControl()) {
|
2376
|
+
ctrl.SetKeyboardLanguage();
|
2377
|
+
}
|
2378
|
+
if (ctrl.Type === MgControlType.CTRL_TYPE_BUTTON)
|
2379
|
+
task.ActionManager.enable(InternalInterface.MG_ACT_BUTTON, false);
|
2380
|
+
if (task.getEnableZoomHandler() || ctrl.useZoomHandler())
|
2381
|
+
task.ActionManager.enable(InternalInterface.MG_ACT_ZOOM, false);
|
2382
|
+
task.ActionManager.enable(InternalInterface.MG_ACT_RT_EDT_NULL, false);
|
2383
|
+
}
|
2384
|
+
if (rcBefore) {
|
2385
|
+
if (this.GetStopExecutionFlag()) {
|
2386
|
+
ctrl.InControl = true;
|
2387
|
+
return;
|
2388
|
+
}
|
2389
|
+
let fld = ctrl.getField();
|
2390
|
+
if (fld != null && (ctrl.Type === MgControlType.CTRL_TYPE_TEXT))
|
2391
|
+
await fld.updateDisplay();
|
2392
|
+
task.setLevel(Constants.TASK_LEVEL_RECORD);
|
2393
|
+
ctrl.setInControlSuffix(false);
|
2394
|
+
ctrl.IsInteractiveUpdate = false;
|
2395
|
+
if (ctrl.PropertyExists(PropInterface.PROP_TYPE_CUSTOM_VALIDATORS))
|
2396
|
+
await ctrl.getProp(PropInterface.PROP_TYPE_CUSTOM_VALIDATORS).RefreshDisplay(true);
|
2397
|
+
ctrl.ValidateControl = false;
|
2398
|
+
LastFocusedManager.setLastFocusedControl(task, null);
|
2399
|
+
if (await task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE))
|
2400
|
+
await task.endTask(true, false, false);
|
2401
|
+
}
|
2402
|
+
break;
|
2403
|
+
case InternalInterface.MG_ACT_TASK_PREFIX:
|
2404
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
2405
|
+
break;
|
2406
|
+
case InternalInterface.MG_ACT_TASK_SUFFIX:
|
2407
|
+
task.setLevel(Constants.TASK_LEVEL_NONE);
|
2408
|
+
break;
|
2409
|
+
case InternalInterface.MG_ACT_CYCLE_NEXT_REC:
|
2410
|
+
let form = task.getForm();
|
2411
|
+
if (!task.isMainProg() && form != null) {
|
2412
|
+
await form.moveInView(form.isLineMode()
|
2413
|
+
? Constants.MOVE_UNIT_ROW
|
2414
|
+
: Constants.MOVE_UNIT_PAGE, Constants.MOVE_DIRECTION_NEXT);
|
2415
|
+
if (task.getExecEndTask())
|
2416
|
+
await task.endTask(true, false, false);
|
2417
|
+
}
|
2418
|
+
break;
|
2419
|
+
case InternalInterface.MG_ACT_CYCLE_NEXT_DELETE_REC:
|
2420
|
+
if (task.DataView.isEmptyDataview())
|
2421
|
+
(task).setExecEndTask();
|
2422
|
+
else
|
2423
|
+
await this.HandleActionDelline(task, dv, rec, true);
|
2424
|
+
if (task.getExecEndTask())
|
2425
|
+
await task.endTask(true, false, false);
|
2426
|
+
break;
|
2427
|
+
case InternalInterface.MG_ACT_SET_EXTERNAL_VALUE:
|
2428
|
+
let refreshDisplay = await evt.getArgList().getArgValue(1, StorageAttribute.BOOLEAN, 0) === '1' ? true : false;
|
2429
|
+
await ctrl.validateAndSetValueIfAllowed(evt.getValue(), refreshDisplay);
|
2430
|
+
break;
|
2431
|
+
}
|
2432
|
+
}
|
2433
|
+
}
|
2434
|
+
async handleNonReversibleEvent(task, eventCode) {
|
2435
|
+
let rtEvt = new RunTimeEvent(task);
|
2436
|
+
let exitCommand = (eventCode === InternalInterface.MG_ACT_EXIT || eventCode === InternalInterface.MG_ACT_CLOSE);
|
2437
|
+
rtEvt.setInternal(eventCode);
|
2438
|
+
if (exitCommand)
|
2439
|
+
this._isNonReversibleExit = true;
|
2440
|
+
try {
|
2441
|
+
rtEvt.setNonReversibleExit();
|
2442
|
+
rtEvt.setCtrl(task.getLastParkedCtrl());
|
2443
|
+
rtEvt.setArgList(null);
|
2444
|
+
await this.handleEvent(rtEvt, false);
|
2445
|
+
}
|
2446
|
+
finally {
|
2447
|
+
if (exitCommand)
|
2448
|
+
this._isNonReversibleExit = false;
|
2449
|
+
}
|
2450
|
+
}
|
2451
|
+
async handleInternalEventWithTaskAndEventSubtype(task, eventCode, eventSubType) {
|
2452
|
+
let lastParkedCtrl = task.getLastParkedCtrl();
|
2453
|
+
let rtEvt;
|
2454
|
+
if (eventCode < InternalInterface.MG_ACT_TOT_CNT && task != null && !(eventSubType === EventSubType.CancelIsQuit) && !task.ActionManager.isEnabled(eventCode))
|
2455
|
+
return;
|
2456
|
+
if (lastParkedCtrl !== null)
|
2457
|
+
await this.handleInternalEventWithMgControl(lastParkedCtrl, eventCode, eventSubType);
|
2458
|
+
else {
|
2459
|
+
if (eventCode === InternalInterface.MG_ACT_RT_QUIT)
|
2460
|
+
await this.handleInternalEventWithTaskAndEventSubtype(task, InternalInterface.MG_ACT_CANCEL, EventSubType.CancelIsQuit);
|
2461
|
+
else {
|
2462
|
+
rtEvt = new RunTimeEvent(task);
|
2463
|
+
rtEvt.setInternal(eventCode);
|
2464
|
+
rtEvt.SetEventSubType(eventSubType);
|
2465
|
+
if (InternalInterface.BuiltinEvent(eventCode))
|
2466
|
+
await this.handleEvent(rtEvt, false);
|
2467
|
+
else
|
2468
|
+
await this.commonHandler(rtEvt);
|
2469
|
+
}
|
2470
|
+
}
|
2471
|
+
}
|
2472
|
+
async handleInternalEventWithMgControl(ctrl, eventCode, eventSubType) {
|
2473
|
+
let rtEvt;
|
2474
|
+
if (eventCode === InternalInterface.MG_ACT_RT_QUIT)
|
2475
|
+
await this.handleInternalEventWithMgControl(ctrl, InternalInterface.MG_ACT_CANCEL, EventSubType.CancelIsQuit);
|
2476
|
+
else {
|
2477
|
+
rtEvt = new RunTimeEvent(ctrl);
|
2478
|
+
rtEvt.setInternal(eventCode);
|
2479
|
+
rtEvt.SetEventSubType(eventSubType);
|
2480
|
+
if (eventCode === InternalInterface.MG_ACT_RT_REFRESH_VIEW)
|
2481
|
+
rtEvt.setIsRealRefresh(false);
|
2482
|
+
if (InternalInterface.BuiltinEvent(eventCode))
|
2483
|
+
await this.handleEvent(rtEvt, false);
|
2484
|
+
else
|
2485
|
+
await this.commonHandler(rtEvt);
|
2486
|
+
}
|
2487
|
+
}
|
2488
|
+
getCurrField() {
|
2489
|
+
return this._currField;
|
2490
|
+
}
|
2491
|
+
getCurrCtrl() {
|
2492
|
+
return this._currCtrl;
|
2493
|
+
}
|
2494
|
+
getCurrTask() {
|
2495
|
+
if (this._currField == null)
|
2496
|
+
return null;
|
2497
|
+
return this._currField.getTask();
|
2498
|
+
}
|
2499
|
+
setStopExecution(stop, clearEventsOnStopExecution) {
|
2500
|
+
if (arguments.length === 1)
|
2501
|
+
this.setStopExecution_0(stop);
|
2502
|
+
else
|
2503
|
+
this.setStopExecution_1(stop, clearEventsOnStopExecution);
|
2504
|
+
}
|
2505
|
+
setStopExecution_0(stop) {
|
2506
|
+
this.setStopExecution(stop, ClearEventsOnStopExecution.ALL);
|
2507
|
+
}
|
2508
|
+
setStopExecution_1(stop, clearEventsOnStopExecution) {
|
2509
|
+
if (stop)
|
2510
|
+
if (clearEventsOnStopExecution == ClearEventsOnStopExecution.ALL)
|
2511
|
+
this._eventsQueue.clear();
|
2512
|
+
else if (clearEventsOnStopExecution == ClearEventsOnStopExecution.SERVER) {
|
2513
|
+
let tmpVec = new List();
|
2514
|
+
let rtEvt;
|
2515
|
+
let i;
|
2516
|
+
while (!this._eventsQueue.isEmpty()) {
|
2517
|
+
rtEvt = this._eventsQueue.poll();
|
2518
|
+
if (rtEvt.isFromServer()) {
|
2519
|
+
rtEvt.resetFromServer();
|
2520
|
+
tmpVec.push(rtEvt);
|
2521
|
+
}
|
2522
|
+
}
|
2523
|
+
for (i = 0; i < tmpVec.length; i++)
|
2524
|
+
this._eventsQueue.put(tmpVec.get_Item(i));
|
2525
|
+
}
|
2526
|
+
this._stopExecution = stop;
|
2527
|
+
}
|
2528
|
+
setStopExecutionCtrl(ctrl) {
|
2529
|
+
if (this._stopExecutionCtrl === null || ctrl === null)
|
2530
|
+
this._stopExecutionCtrl = ctrl;
|
2531
|
+
}
|
2532
|
+
async delCurrRec(task, inForceDel) {
|
2533
|
+
let dv = task.DataView;
|
2534
|
+
task.setMode(Constants.TASK_MODE_MODIFY);
|
2535
|
+
await task.getForm().delCurrRec();
|
2536
|
+
if (!task.DataView.isEmptyDataview()) {
|
2537
|
+
if (dv.getCurrRecIdx() >= 0) {
|
2538
|
+
if ((dv.getCurrRec()).getMode() !== DataModificationTypes.Delete && !inForceDel) {
|
2539
|
+
let ctrl = task.getLastParkedCtrl();
|
2540
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2541
|
+
if (!this.GetStopExecutionFlag())
|
2542
|
+
if (ctrl === null)
|
2543
|
+
await this.HandleNonParkableControls(task);
|
2544
|
+
else
|
2545
|
+
await this.handleInternalEventWithMgControlBase(ctrl, InternalInterface.MG_ACT_CTRL_PREFIX);
|
2546
|
+
}
|
2547
|
+
}
|
2548
|
+
else if (!task.getInCreateLine())
|
2549
|
+
await this.handleNonReversibleEvent(task, InternalInterface.MG_ACT_EXIT);
|
2550
|
+
}
|
2551
|
+
else {
|
2552
|
+
await this.HandleNonParkableControls(task);
|
2553
|
+
await this.handleInternalEventWithTask(task, InternalInterface.MG_ACT_REC_PREFIX);
|
2554
|
+
}
|
2555
|
+
}
|
2556
|
+
async updateConfirmed(task) {
|
2557
|
+
let confirm;
|
2558
|
+
let answer;
|
2559
|
+
let ans;
|
2560
|
+
if (task == null)
|
2561
|
+
return false;
|
2562
|
+
confirm = await task.checkProp(PropInterface.PROP_TYPE_CONFIRM_UPDATE, false);
|
2563
|
+
if (!this._isInRecordFlushEvent && confirm && !task.DataSynced) {
|
2564
|
+
ans = await GUIManager.Instance.confirm(MsgInterface.CRF_STR_CONF_UPD, Styles.MSGBOX_ICON_QUESTION | Styles.MSGBOX_BUTTON_YES_NO_CANCEL);
|
2565
|
+
if (ans === Styles.MSGBOX_RESULT_YES)
|
2566
|
+
answer = 'Y';
|
2567
|
+
else if (ans === Styles.MSGBOX_RESULT_NO)
|
2568
|
+
answer = 'N';
|
2569
|
+
else
|
2570
|
+
answer = 'C';
|
2571
|
+
}
|
2572
|
+
else
|
2573
|
+
answer = 'Y';
|
2574
|
+
switch (answer) {
|
2575
|
+
case 'Y':
|
2576
|
+
break;
|
2577
|
+
case 'N':
|
2578
|
+
await task.getForm().cancelEdit(false, false);
|
2579
|
+
await task.getForm().RefreshDisplay(Constants.TASK_REFRESH_CURR_REC);
|
2580
|
+
task.ConfirmUpdateNo = true;
|
2581
|
+
return false;
|
2582
|
+
case 'C':
|
2583
|
+
this.setStopExecution(true);
|
2584
|
+
this.setStopExecutionCtrl(LastFocusedManager.getLastFocusedControl());
|
2585
|
+
await FocusManager.SetFocus(LastFocusedManager.getLastFocusedControl(), -1);
|
2586
|
+
return false;
|
2587
|
+
default:
|
2588
|
+
Logger.Instance.WriteExceptionToLogWithMsg('in ClientManager.Instance.updateConfirmed() illegal confirmation code: ' +
|
2589
|
+
confirm);
|
2590
|
+
break;
|
2591
|
+
}
|
2592
|
+
return true;
|
2593
|
+
}
|
2594
|
+
setCompMainPrgTab(compMainPrgTable) {
|
2595
|
+
this._compMainPrgTab = compMainPrgTable;
|
2596
|
+
}
|
2597
|
+
setEndOfWork(endOfWork_) {
|
2598
|
+
this._endOfWork = endOfWork_;
|
2599
|
+
}
|
2600
|
+
getEndOfWork() {
|
2601
|
+
return this._endOfWork;
|
2602
|
+
}
|
2603
|
+
getCompMainPrgTab() {
|
2604
|
+
return this._compMainPrgTab;
|
2605
|
+
}
|
2606
|
+
inNonReversibleExit() {
|
2607
|
+
return this._isNonReversibleExit;
|
2608
|
+
}
|
2609
|
+
pushRtEvent(rtEvt) {
|
2610
|
+
this._rtEvents.push(rtEvt);
|
2611
|
+
}
|
2612
|
+
popRtEvent() {
|
2613
|
+
if (this._rtEvents.count() === 0)
|
2614
|
+
return null;
|
2615
|
+
return this._rtEvents.pop();
|
2616
|
+
}
|
2617
|
+
storeLastSavedRouteEventOnLocalStorage() {
|
2618
|
+
let dataStorage = window.localStorage;
|
2619
|
+
if (this.getLastSavedRouteEvent() != null) {
|
2620
|
+
let rtEvt = this.getLastSavedRouteEvent();
|
2621
|
+
dataStorage.setItem(ConstInterface.LAST_ROUTE_EVENT, '1');
|
2622
|
+
dataStorage.setItem(ConstInterface.LAST_ROUTE_EVENT_SRC_TSK, JSON.stringify(rtEvt.getTask().TaskDefinitionId));
|
2623
|
+
if (rtEvt.getArgList().getSize() > 0) {
|
2624
|
+
let str = new StringBuilder();
|
2625
|
+
rtEvt.getArgList().buildXML(str);
|
2626
|
+
dataStorage.setItem(ConstInterface.LAST_ROUTE_EVENT_ARG_LIST, str.toString());
|
2627
|
+
}
|
2628
|
+
}
|
2629
|
+
}
|
2630
|
+
restoreLastSavedRouteEventFromLocalStorage() {
|
2631
|
+
let dataStorage = window.localStorage;
|
2632
|
+
let lastRouteEvent = dataStorage.getItem(ConstInterface.LAST_ROUTE_EVENT);
|
2633
|
+
if (lastRouteEvent === '1') {
|
2634
|
+
let srcTaskDefinitionStr = dataStorage.getItem(ConstInterface.LAST_ROUTE_EVENT_SRC_TSK);
|
2635
|
+
let routeArgListStr = dataStorage.getItem(ConstInterface.LAST_ROUTE_EVENT_ARG_LIST);
|
2636
|
+
let taskDefinitionId = new TaskDefinitionId();
|
2637
|
+
taskDefinitionId.fromJSON(srcTaskDefinitionStr);
|
2638
|
+
let srcTask = MGDataCollection.Instance.getCurrMGData().getTaskByTaskDefinitionID(taskDefinitionId);
|
2639
|
+
let args = null;
|
2640
|
+
if (routeArgListStr != null) {
|
2641
|
+
args = new ArgumentsList();
|
2642
|
+
args.fillList(routeArgListStr, srcTask);
|
2643
|
+
}
|
2644
|
+
EventsManager.Instance.AddLastSavedRouteEvent(srcTask, args);
|
2645
|
+
}
|
2646
|
+
}
|
2647
|
+
getLastSavedRouteEvent() {
|
2648
|
+
return this.lastSavedRouteEvent;
|
2649
|
+
}
|
2650
|
+
setLastSavedRouteEvent(rtEvt) {
|
2651
|
+
if (rtEvt == null)
|
2652
|
+
this.lastSavedRouteEvent = null;
|
2653
|
+
else
|
2654
|
+
this.lastSavedRouteEvent = rtEvt.replicate();
|
2655
|
+
}
|
2656
|
+
getLastRtEvent() {
|
2657
|
+
if (this._rtEvents.count() === 0)
|
2658
|
+
return null;
|
2659
|
+
return this._rtEvents.peek();
|
2660
|
+
}
|
2661
|
+
setIgnoreUnknownAbort(val) {
|
2662
|
+
this._ignoreUnknownAbort = val;
|
2663
|
+
}
|
2664
|
+
ignoreUnknownAbort() {
|
2665
|
+
return this._ignoreUnknownAbort;
|
2666
|
+
}
|
2667
|
+
async failTaskOverlay(taskId, mgd) {
|
2668
|
+
let cmd;
|
2669
|
+
if (taskId !== null) {
|
2670
|
+
this.setIgnoreUnknownAbort(true);
|
2671
|
+
try {
|
2672
|
+
cmd = CommandFactory.CreateNonReversibleExitCommand(taskId, false);
|
2673
|
+
mgd.CmdsToServer.Add(cmd);
|
2674
|
+
await RemoteCommandsProcessor.GetInstance().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
2675
|
+
}
|
2676
|
+
finally {
|
2677
|
+
this.setIgnoreUnknownAbort(false);
|
2678
|
+
}
|
2679
|
+
}
|
2680
|
+
}
|
2681
|
+
isEventScopeTrans() {
|
2682
|
+
return this._eventScope === EventScope.TRANS;
|
2683
|
+
}
|
2684
|
+
setEventScopeTrans() {
|
2685
|
+
this._eventScope = EventScope.TRANS;
|
2686
|
+
}
|
2687
|
+
clearEventScope() {
|
2688
|
+
this._eventScope = EventScope.NONE;
|
2689
|
+
}
|
2690
|
+
GetEventTime() {
|
2691
|
+
return this._eventsQueue.GetTime();
|
2692
|
+
}
|
2693
|
+
getMatchingAction(kbItm) {
|
2694
|
+
let act = 0;
|
2695
|
+
if (kbItm == null)
|
2696
|
+
return act;
|
2697
|
+
if (act === 0) {
|
2698
|
+
if (kbItm.getAction() !== 0)
|
2699
|
+
act = kbItm.getAction();
|
2700
|
+
else if (kbItm.getKeyCode() === 45 && kbItm.getModifier() === Modifiers.MODIFIER_NONE && kbItm.getStates() === 0)
|
2701
|
+
act = InternalInterface.MG_ACT_TOGGLE_INSERT;
|
2702
|
+
}
|
2703
|
+
return (act);
|
2704
|
+
}
|
2705
|
+
getExecStack() {
|
2706
|
+
return this._execStack.peek();
|
2707
|
+
}
|
2708
|
+
pushExecStack(taskId, handlerId, operIdx) {
|
2709
|
+
this._execStack.peek().push(MGDataCollection.Instance.getTaskIdById(taskId), handlerId, operIdx);
|
2710
|
+
}
|
2711
|
+
popExecStack() {
|
2712
|
+
return this._execStack.peek().pop();
|
2713
|
+
}
|
2714
|
+
pushNewExecStacks() {
|
2715
|
+
this._serverExecStack.push(null);
|
2716
|
+
this._execStack.push(new ExecutionStack());
|
2717
|
+
}
|
2718
|
+
popNewExecStacks() {
|
2719
|
+
this._serverExecStack.pop();
|
2720
|
+
this._execStack.pop();
|
2721
|
+
}
|
2722
|
+
pushServerExecStack(taskId, handlerId, operIdx) {
|
2723
|
+
if (this._serverExecStack.peek() === null) {
|
2724
|
+
this._serverExecStack.pop();
|
2725
|
+
this._serverExecStack.push(new ExecutionStack());
|
2726
|
+
}
|
2727
|
+
this._serverExecStack.peek().push(taskId, handlerId, operIdx);
|
2728
|
+
}
|
2729
|
+
clearServerExecStack() {
|
2730
|
+
if (this._serverExecStack.peek() !== null) {
|
2731
|
+
this._serverExecStack.peek().clear();
|
2732
|
+
}
|
2733
|
+
}
|
2734
|
+
reverseServerExecStack() {
|
2735
|
+
if (this._serverExecStack.peek() !== null)
|
2736
|
+
this._serverExecStack.peek().reverse();
|
2737
|
+
}
|
2738
|
+
getNextOperIdx(oper, clearWhenFound) {
|
2739
|
+
let tmpServerExecStackEntry = null;
|
2740
|
+
let nextOperIdx = -1;
|
2741
|
+
if (this._serverExecStack.count() !== 0 && this._serverExecStack.peek() !== null && !this._serverExecStack.peek().empty()) {
|
2742
|
+
if (this._serverExecStack.peek().size() > this._execStack.peek().size()) {
|
2743
|
+
let tmpServerExecStack = new ExecutionStack(this._serverExecStack.peek());
|
2744
|
+
while (tmpServerExecStack.size() > this._execStack.peek().size()) {
|
2745
|
+
tmpServerExecStackEntry = tmpServerExecStack.pop();
|
2746
|
+
}
|
2747
|
+
if (this._execStack.peek().Equals(tmpServerExecStack) && tmpServerExecStackEntry.TaskId === oper.getTaskTag() && tmpServerExecStackEntry.HandlerId === oper.getHandlerId() && tmpServerExecStackEntry.OperIdx >= oper.getServerId()) {
|
2748
|
+
nextOperIdx = tmpServerExecStackEntry.OperIdx;
|
2749
|
+
if (clearWhenFound && this._serverExecStack.peek().size() === this._execStack.peek().size() + 1) {
|
2750
|
+
this._serverExecStack.peek().clear();
|
2751
|
+
}
|
2752
|
+
}
|
2753
|
+
else
|
2754
|
+
nextOperIdx = EventsManager.MAX_OPER;
|
2755
|
+
}
|
2756
|
+
else {
|
2757
|
+
nextOperIdx = EventsManager.MAX_OPER;
|
2758
|
+
}
|
2759
|
+
}
|
2760
|
+
return nextOperIdx;
|
2761
|
+
}
|
2762
|
+
setProcessingTopMostEndTask(inProcessingTopMostEndTask) {
|
2763
|
+
this._processingTopMostEndTask = inProcessingTopMostEndTask;
|
2764
|
+
}
|
2765
|
+
getProcessingTopMostEndTask() {
|
2766
|
+
return this._processingTopMostEndTask;
|
2767
|
+
}
|
2768
|
+
setAllowEvents(AllowEvents) {
|
2769
|
+
this._allowEvents = AllowEvents;
|
2770
|
+
}
|
2771
|
+
setNonInteractiveAllowEvents(AllowEvents) {
|
2772
|
+
if (AllowEvents)
|
2773
|
+
this._allowEvents = EventsAllowedType.NON_INTERACTIVE;
|
2774
|
+
else
|
2775
|
+
this._allowEvents = EventsAllowedType.NONE;
|
2776
|
+
}
|
2777
|
+
getAllowEvents() {
|
2778
|
+
return this._allowEvents;
|
2779
|
+
}
|
2780
|
+
NoEventsAllowed() {
|
2781
|
+
return this._allowEvents === EventsAllowedType.NONE;
|
2782
|
+
}
|
2783
|
+
async handleCtrlModify(ctrl, act) {
|
2784
|
+
if (ctrl == null || !ctrl.isModifiable())
|
2785
|
+
return;
|
2786
|
+
switch (act) {
|
2787
|
+
case InternalInterface.MG_ACT_RT_EDT_NULL:
|
2788
|
+
case InternalInterface.MG_ACT_CTRL_MODIFY:
|
2789
|
+
case InternalInterface.MG_ACT_SELECTION:
|
2790
|
+
break;
|
2791
|
+
default:
|
2792
|
+
return;
|
2793
|
+
}
|
2794
|
+
let rtEvt;
|
2795
|
+
rtEvt = new RunTimeEvent(ctrl);
|
2796
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_CTRL_MODIFY);
|
2797
|
+
await this.handleEvent(rtEvt, false);
|
2798
|
+
}
|
2799
|
+
ActAllowed(act) {
|
2800
|
+
let allowed = true;
|
2801
|
+
switch (this.getAllowEvents()) {
|
2802
|
+
case EventsAllowedType.ALL:
|
2803
|
+
allowed = true;
|
2804
|
+
break;
|
2805
|
+
case EventsAllowedType.NONE:
|
2806
|
+
allowed = (act === InternalInterface.MG_ACT_CRELINE);
|
2807
|
+
break;
|
2808
|
+
case EventsAllowedType.NON_INTERACTIVE:
|
2809
|
+
switch (act) {
|
2810
|
+
case InternalInterface.MG_ACT_EXIT_SYSTEM:
|
2811
|
+
case InternalInterface.MG_ACT_EXIT:
|
2812
|
+
case InternalInterface.MG_ACT_CLOSE:
|
2813
|
+
case InternalInterface.MG_ACT_CRELINE:
|
2814
|
+
case InternalInterface.MG_ACT_CRELINE_ABOVE:
|
2815
|
+
case InternalInterface.MG_ACT_ROLLBACK:
|
2816
|
+
allowed = true;
|
2817
|
+
break;
|
2818
|
+
default:
|
2819
|
+
allowed = false;
|
2820
|
+
break;
|
2821
|
+
}
|
2822
|
+
break;
|
2823
|
+
}
|
2824
|
+
return allowed;
|
2825
|
+
}
|
2826
|
+
async commitRecord(task, isReversibleExit) {
|
2827
|
+
let dv = task.DataView;
|
2828
|
+
let rec = dv.getCurrRec();
|
2829
|
+
let forceSuffix = await task.checkProp(PropInterface.PROP_TYPE_FORCE_SUFFIX, false);
|
2830
|
+
let isSelectionTable = await task.checkProp(PropInterface.PROP_TYPE_SELECTION, false);
|
2831
|
+
let isNewRec = rec.isNewRec();
|
2832
|
+
let savePrevCurrRec = true;
|
2833
|
+
let recModified = rec.Modified;
|
2834
|
+
if (!dv.recInModifiedTab(rec.getId()))
|
2835
|
+
rec.clearFlagsHistory();
|
2836
|
+
await task.TaskTransactionManager.checkAndCommit(isReversibleExit, ConstInterface.TRANS_RECORD_PREFIX, task.ConfirmUpdateNo);
|
2837
|
+
if (task.transactionFailed(ConstInterface.TRANS_RECORD_PREFIX)) {
|
2838
|
+
try {
|
2839
|
+
task.DataSynced = true;
|
2840
|
+
this.setStopExecution(false);
|
2841
|
+
await task.handleEventOnSlaveTasks(InternalInterface.MG_ACT_REC_PREFIX);
|
2842
|
+
}
|
2843
|
+
finally {
|
2844
|
+
this.setStopExecution(true);
|
2845
|
+
}
|
2846
|
+
}
|
2847
|
+
else if (task.isAborting())
|
2848
|
+
this.setStopExecution(true);
|
2849
|
+
else {
|
2850
|
+
if (recModified)
|
2851
|
+
rec.setLateCompute(true);
|
2852
|
+
if (!this._stopExecution)
|
2853
|
+
task.setLevel(Constants.TASK_LEVEL_TASK);
|
2854
|
+
rec.resetUpdated();
|
2855
|
+
rec.resetModified();
|
2856
|
+
if (!recModified && !forceSuffix && (!isSelectionTable || !task.InSelect)) {
|
2857
|
+
if (isNewRec) {
|
2858
|
+
dv.setPrevCurrRec();
|
2859
|
+
savePrevCurrRec = false;
|
2860
|
+
rec.setNewRec();
|
2861
|
+
await task.getForm().cancelEdit(false, false);
|
2862
|
+
await this.HandleStopRowEditing(task);
|
2863
|
+
}
|
2864
|
+
else if (!rec.getForceSaveOrg())
|
2865
|
+
await dv.cancelEdit(EventsManager.REAL_ONLY, true);
|
2866
|
+
else
|
2867
|
+
dv.saveOriginal();
|
2868
|
+
}
|
2869
|
+
else
|
2870
|
+
dv.saveOriginal();
|
2871
|
+
}
|
2872
|
+
if (savePrevCurrRec)
|
2873
|
+
dv.setPrevCurrRec();
|
2874
|
+
}
|
2875
|
+
incLocateTimerCB(taskObj) {
|
2876
|
+
let task = taskObj;
|
2877
|
+
let rtEvt = new RunTimeEvent(task, true);
|
2878
|
+
rtEvt.setInternal(InternalInterface.MG_ACT_INCREMENTAL_LOCATE);
|
2879
|
+
rtEvt.setMainPrgCreator(task);
|
2880
|
+
rtEvt.setCtrl(task.getLastParkedCtrl());
|
2881
|
+
this.addToTail(rtEvt);
|
2882
|
+
}
|
2883
|
+
static async doSyncForSubformParent(task) {
|
2884
|
+
let parentTask = task.getParent();
|
2885
|
+
let parentDv = parentTask.DataView;
|
2886
|
+
let parentRec = parentDv.getCurrRec();
|
2887
|
+
if (task.IsSubForm && parentRec != null && parentRec.Modified && !parentDv.isEmptyDataview()) {
|
2888
|
+
parentRec.setMode(DataModificationTypes.Update);
|
2889
|
+
await parentDv.addCurrToModified(false);
|
2890
|
+
((parentDv.getCurrRec())).Synced = true;
|
2891
|
+
parentDv.setChanged(true);
|
2892
|
+
let dataViewExecuteLocalUpdatesCommand = CommandFactory.CreateDataViewCommand(parentTask.getTaskTag(), DataViewCommandType.ExecuteLocalUpdates);
|
2893
|
+
await parentTask.DataviewManager.Execute(dataViewExecuteLocalUpdatesCommand);
|
2894
|
+
}
|
2895
|
+
}
|
2896
|
+
async ProcessAbortingError(ex) {
|
2897
|
+
let eMsg;
|
2898
|
+
let errForConsole;
|
2899
|
+
let errForMsgBox;
|
2900
|
+
if (ex instanceof ServerError)
|
2901
|
+
eMsg = ex.GetMessage();
|
2902
|
+
else
|
2903
|
+
eMsg = ((ex.Message !== null) ? ex.Message : ex.GetType());
|
2904
|
+
errForConsole = StrUtil.getConsoleErorString(eMsg);
|
2905
|
+
errForMsgBox = StrUtil.getMsgBoxErorString(eMsg);
|
2906
|
+
if (ex.InnerException !== null)
|
2907
|
+
Logger.Instance.WriteExceptionToLog(ex.InnerException, errForConsole);
|
2908
|
+
else {
|
2909
|
+
if (!(ex instanceof ServerError) || Logger.Instance.LogLevel !== Logger_LogLevels.Basic) {
|
2910
|
+
Logger.Instance.WriteExceptionToLogWithMsg(errForConsole);
|
2911
|
+
}
|
2912
|
+
}
|
2913
|
+
let sendUnloadToServer = RuntimeContextBase.Instance.ContextID !== RuntimeContextBase.noContextId;
|
2914
|
+
MGDataCollection.Instance.currMgdID = 0;
|
2915
|
+
let messageString = LanguageData.Instance.getConstMessage(MsgInterface.BRKTAB_STR_ERROR);
|
2916
|
+
let style = 16;
|
2917
|
+
if (ex.Message.startsWith('<HTML')) {
|
2918
|
+
this.processHTMLContent(ex.Message);
|
2919
|
+
}
|
2920
|
+
else {
|
2921
|
+
if (this.ShowErrorInMessageBox(ex)) {
|
2922
|
+
await GUIManager.Instance.MessageBox(messageString, errForMsgBox, style);
|
2923
|
+
}
|
2924
|
+
if (ex instanceof ServerError) {
|
2925
|
+
if (ex.GetCode() == ServerError.ERR_WEBCLIENT_PROGRAM_RELOADED ||
|
2926
|
+
ex.GetCode() == ServerError.ERR_EXECUTED_PROGRAM_CHANGED) {
|
2927
|
+
Commands.addGlobalCommand(CommandType.RELOAD_PAGE);
|
2928
|
+
Commands.beginInvoke();
|
2929
|
+
}
|
2930
|
+
}
|
2931
|
+
}
|
2932
|
+
if (ex instanceof ServerError) {
|
2933
|
+
if (ex.GetCode() === ServerError.ERR_CTX_NOT_FOUND ||
|
2934
|
+
ex.GetCode() === ServerError.ERR_WEBCLIENT_PROGRAM_RELOADED ||
|
2935
|
+
ex.GetCode() === ServerError.ERR_EXECUTED_PROGRAM_CHANGED) {
|
2936
|
+
sendUnloadToServer = false;
|
2937
|
+
}
|
2938
|
+
}
|
2939
|
+
if (sendUnloadToServer) {
|
2940
|
+
try {
|
2941
|
+
let cmd = CommandFactory.CreateUnloadCommand();
|
2942
|
+
MGDataCollection.Instance.getMGData(0).CmdsToServer.Add(cmd);
|
2943
|
+
await CommandsProcessorManager.GetCommandsProcessor().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
|
2944
|
+
}
|
2945
|
+
catch (ex3) {
|
2946
|
+
if (ex3 instanceof ApplicationException) {
|
2947
|
+
Logger.Instance.WriteExceptionToLog(ex3);
|
2948
|
+
}
|
2949
|
+
else
|
2950
|
+
throw ex3;
|
2951
|
+
}
|
2952
|
+
}
|
2953
|
+
GUIManager.Instance.abort();
|
2954
|
+
}
|
2955
|
+
processHTMLContent(htmlContent) {
|
2956
|
+
Commands.addShowHTMLError(CommandType.SHOW_HTML_ERROR, htmlContent);
|
2957
|
+
Commands.beginInvoke();
|
2958
|
+
}
|
2959
|
+
ShowErrorInMessageBox(ex) {
|
2960
|
+
if (!(ex instanceof ServerError))
|
2961
|
+
return true;
|
2962
|
+
if ((ex.GetCode() == ServerError.ERR_EXECUTED_PROGRAM_CHANGED ||
|
2963
|
+
ex.GetCode() == ServerError.ERR_WEBCLIENT_PROGRAM_RELOADED) &&
|
2964
|
+
RuntimeContextBase.Instance.ContextID === RuntimeContextBase.noContextId)
|
2965
|
+
return false;
|
2966
|
+
return true;
|
2967
|
+
}
|
2968
|
+
getIsInViewRefresh() {
|
2969
|
+
return this.isInViewRefresh;
|
2970
|
+
}
|
2971
|
+
setIsInViewRefresh(inViewRefresh) {
|
2972
|
+
this.isInViewRefresh = inViewRefresh;
|
2973
|
+
}
|
2974
|
+
}
|
2975
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXZlbnRzTWFuYWdlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvZXZlbnQvRXZlbnRzTWFuYWdlci50cy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XJlLlxyXG4gICAgICAgICAgICBpZiAocnRFdnQuZ2V0SW50ZXJuYWxDb2RlKCkgIT09IEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9UQVNLX1BSRUZJWCAmJiB0YXNrLmlzU3RhcnRlZCgpICYmIHRhc2suZ2V0RXhlY0VuZFRhc2soKSkge1xyXG4gICAgICAgICAgICAgIGVuZFRhc2tFcnJvciA9IGF3YWl0IHRhc2suZW5kVGFzayh0cnVlLCBmYWxzZSwgZmFsc2UpO1xyXG4gICAgICAgICAgICAgIGlmIChlbmRUYXNrRXJyb3IpXHJcbiAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgaWYgKHRoaXMuR2V0U3RvcEV4ZWN1dGlvbkZsYWcoKSkge1xyXG4gICAgICAgICAgICAgIGlmIChhd2FpdCB0aGlzLmhhbmRsZVN0b3BFeGVjdXRpb24ocnRFdnQpKVxyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgIH0gZmluYWxseSB7XHJcbiAgICAgICAgICAgIC8vIHJlc3RvcmluZyB0aGUgY29udGV4dFxyXG4gICAgICAgICAgICBoYW5kbGVyLmdldFRhc2soKS5TZXRDb250ZXh0VGFzayhoYW5kbGVyQ29udGV4dFRhc2spO1xyXG4gICAgICAgICAgfVxyXG5cclxuICAgICAgICAgIGlmICghcHJvcGFnYXRlKVxyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBpZiAocnRFdnRDaGFuZ2VkKVxyXG4gICAgICAgICAgICBoYW5kbGVyID0gcG9zLmdldE5leHQocnRFdnQpO1xyXG4gICAgICAgICAgLy8gZ2V0IHRoZSBuZXh0IGhhbmRsZXIgZm9yIHRoZSBjdXJyZW50IGV2ZW50XHJcbiAgICAgICAgICBlbHNlXHJcbiAgICAgICAgICAgIGhhbmRsZXIgPSBwb3MuZ2V0TmV4dCgpO1xyXG4gICAgIC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hZ2UoKSA+IEludDMyLk1pblZhbHVlICYmIGRpc3BsYXlMaW5lID4gSW50MzIuTWluVmFsdWUpIHtcclxuICAgICAgICAgICAgLy8gZW5zdXJlIGEgdmFsaWQgcm93XHJcbiAgICAgICAgICAgIHdoaWxlICghZHYucmVjRXhpc3RzKGRpc3BsYXlMaW5lKSAmJiBkaXNwbGF5TGluZSA+IDApIHtcclxuICAgICAgICAgICAgICBkaXNwbGF5TGluZS0tO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChkaXNwbGF5TGluZSA+PSAwKSB7XHJcbiAgICAgICAgICAgICAgcHJldlJlYyA9IGR2LmdldEN1cnJSZWMoKTtcclxuICAgICAgICAgICAgICBsZXQgb2xkVGFza01vZGU6IHN0cmluZyA9IHRhc2suZ2V0TW9kZSgpO1xyXG4gICAgICAgICAgICAgIGxldCBvbGRSZWNJZDogbnVtYmVyID0gcHJldlJlYy5nZXRJZCgpO1xyXG5cclxuICAgICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgICAgb2xkRGlzcGxheUxpbmUgPSBmb3JtLkRpc3BsYXlMaW5lO1xyXG4gICAgICAgICAgICAgICAgLy8gb2xkRGlzcGxheUxpbmUgPSBmb3JtLmdldEN1cnJSb3coKVxyXG4gICAgICAgICAgICAgICAgZm9ybS5QcmV2RGlzcGxheUxpbmUgPSBvbGREaXNwbGF5TGluZTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IGZvcm0uc2V0Q3VyclJvd0J5RGlzcGxheUxpbmUoZGlzcGxheUxpbmUsIHRydWUsIGZhbHNlKTtcclxuICAgICAgICAgICAgICAgIC8vIHJlZnJlc2ggdGhlIGRpc3BsYXkgaWYgdGhlIHByZXZpb3VzIHJlY29yZCB3YXMgZGVsZXRlZCBvciBjYW5jZWxlZFxyXG4gICAgICAgICAgICAgICAgaWYgKHByZXZSZWMgIT0gbnVsbCAmJiAhZHYucmVjRXhpc3RzQnlJZChwcmV2UmVjLmdldElkKCk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mVjRXhpc3RzQnlJZChvbGRSZWNJZCkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgIGxldCBwcmV2TGluZTogbnVtYmVyID0gZm9ybS5nZXRQcmV2TGluZShvbGREaXNwbGF5TGluZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBmb3JtLnJlc3RvcmVPbGREaXNwbGF5TGluZShwcmV2TGluZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBmb3JtLnJlc3RvcmVPbGREaXNwbGF5TGluZShvbGREaXNwbGF5TGluZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgYXdhaXQgZm9ybS5SZWZyZXNoRGlzcGxheShDb25zdGFudHMuVEFTS19SRUZSRVNIX0ZPUk0pO1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0U3RvcEV4ZWN1dGlvbihmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgbGFzdEZvY3VzZWRDdHJsID0gPE1nQ29udHJvbD50YXNrLmdldExhc3RQYXJrZWRDdHJsKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgdGFzay5nZXRMYXN0UGFya2VkQ3RybCgpO1xyXG4gICAgICAgICAgICAgICAgICAgIGlmIChsYXN0Rm9jdXNlZEN0cmwgIT0gbnVsbClcclxuICAgICAgICAgICAgICAgICAgICAgIGF3YWl0IGxhc3RGb2N1c2VkQ3RybC5pbnZva2UoKTtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFN0b3BFeGVjdXRpb24odHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgICAgICAgICB9IGVsc2VcclxuICAgICAgICAgICAgICAgICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVEZXZUb0xvZyhlLlN0YWNrVHJhY2UpO1xyXG4gICAgICAgICAgICAgICAgfSBlbHNlIHRocm93IG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rLklzU3ViRm9ybSAmJiB0YXNrLlBlcmZvcm1QYXJlbnRSZWNvcmRQcmVmaXgpIHtcclxuICAgICAgICAgICAgbGV0IHBhcmVudFRhc2sgPSB0YXNrLmdldFBhcmVudCgpO1xyXG4gICAgICAgICAgICB3aGlsZSAocGFyZW50VGFzay5Jc1N1YkZvcm0pIHtcclxuICAgICAgICAgICAgICBpZiAocGFyZW50VGFzay5nZXRMZXZlbCgpID09PSBDb25zdGFudHMuVEFTS19MRVZFTF9UQVNLKSB7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLmhhbmRsZUludGVybmFsRXZlbnRXaXRoVGFzayhwYXJlbnRUYXNrLCBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUkVDX1BSRUZJWCk7XHJcbiAgICAgICAgICAgICAgICBwYXJlbnRUYXNrID0gcGFyZW50VGFzay5nZXRQYXJlbnQoKTtcclxuICAgICAgICAgICAgICAgIGlmICh0aGlzLkdldFN0b3BFeGVjdXRpb25GbGFnKCkpXHJcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgIH0gZWxzZVxyXG4gICAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAvLyBoYW5kbGUgc3ViLWZvcm1zXHJcbiAgICAgICAgICB0YXNrLkluQ29tbW9uSGFuZGxlckJlZm9yZVJQID0gdHJ1ZTtcclxuICAgICAgICAgIGlmIChhd2FpdCB0YXNrLkNoZWNrUmVmcmVzaFN1YlRhc2tzKCkpXHJcbiAgICAgICAgICAgIGF3YWl0IGR2LmNvbXB1dGVTdWJGb3JtcygpO1xyXG4gICAgICAgICAgdGFzay5JbkNvbW1vbkhhbmRsZXJCZWZvcmVSUCA9IGZhbHNlO1xyXG4gICAgICAgICAgdGFzay5zZXRMZXZlbChDb25zdGFudHMuVEFTS19MRVZFTF9SRUNPUkQpO1xyXG4gICAgICAgICAgL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S19NT0RFX0RFTEVURSlcclxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcblxyXG4gICAgICAgICAgLy8gdG8gcHJldmVudCBkb3VibGUgc3VmZml4IG9uIHRoZSBzYW1lIHJlY29yZFxyXG4gICAgICAgICAgaWYgKHRhc2suZ2V0TGV2ZWwoKSA9PT0gQ29uc3RhbnRzLlRBU0tfTEVWRUxfVEFTSylcclxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG5cclxuICAgICAgICAgIGlmICh0YXNrLmdldExldmVsKCkgPT09IENvbnN0YW50cy5UQVNLX0xFVkVMX0NPTlRST0wpIHtcclxuICAgICAgICAgICAgdGFzay5zZXRJblJlY29yZFN1ZmZpeCh0cnVlKTtcclxuICAgICAgICAgICAgYXdhaXQgdGhpcy5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aE1nQ29udHJvbEJhc2UodGFzay5nZXRMYXN0UGFya2VkQ3RybCgpLCBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfQ1RSTF9TVUZGSVgpO1xyXG4gICAgICAgICAgICB0YXNrLnNldEluUmVjb3JkU3VmZml4KGZhbHNlKTtcclxuICAgICAgICAgICAgaWYgKHRoaXMuX3N0b3BFeGVjdXRpb24pXHJcbiAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xyXG4gICAgICAgICAgfVxyXG5cclxuICAgICAgICAgIGF3YWl0IHRhc2suaGFuZGxlRXZlbnRPblNsYXZlVGFza3MoSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JFQ19TVUZGSVgpO1xyXG4gICAgICAgICAgaWYgKHRoaXMuX3N0b3BFeGVjdXRpb24pXHJcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgIExvZ2dlci5JbnN0YW5jZS5Xcml0ZURldlRvTG9nKCdSRUNPUkQgU1VGRklYOiAnICsgdGFzay5xdWVyeVRhc2tQYXRoKCkpO1xyXG5cclxuXHJcbiAgICAgICAgICAvLyB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VRFICYmIHJlYy5Nb2RpZmllZCkge1xyXG4gICAgICAgICAgICBpZiAoIWF3YWl0IHRoaXMudXBkYXRlQ29uZmlybWVkKHRhc2spKVxyXG4gICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICBsZXQgc3RvcEV4ZWN1dGlvbjogYm9vbGVhbiA9ICFhd2FpdCB0aGlzLmV4ZWN1dGVDb250cm9sVmVyaWZpY2F0aW9uKHRhc2spO1xyXG4gICAgICAgICAgLy8gZG8gbm90IGNvbnRpbnVlIHByb2Nlc3NpbmcgUlMgaWYgQ1YgcmV0dXJucyBlcnJvclxyXG4gICAgICAgICAgaWYgKHN0b3BFeGVjdXRpb24pXHJcbiAgICAgICAgICAgIHJldHVybiBmYWxzZTtcclxuICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DVFJMX1BSRUZJWDpcclxuICAgICAgICAgIGlmIChhd2FpdCB0aGlzLmhhbmRsZUN0cmxQcmVmaXgoZXZ0KSlcclxuICAgICAgICAgICAgcmV0dXJuIHRydWU7XHJcbiAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgLy8gZGlkIG5vdCBzdWNjZWVkIGluIGVudGVyaW5nIHRoZSBjdHJsXHJcbiAgICAgICAgICAgIGV2dC5Db250cm9sLkluQ29udHJvbCA9IGZhbHNlO1xyXG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XHJcbiAgICAgICAgICB9XHJcblxyXG4gICAgICAgIGNhc2UgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX0NBTkNFTDpcclxuICAgICAgICAgIE1hbmFnZXIuQ2xlYW5NZXNzYWdlUGFuZSh0YXNrKTsgLy8gUUNSICMzNzEzMjFcclxuICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DVFJM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ZXJzaWJsZUV4aXQoKSwgZmFsc2UsXHJcbiAgICAgICAgICAgICAgZmFsc2UpO1xyXG4gICAgICAgICAgICAvLyBHZXRUb3BNb3N0VGFza1dpdGhGb3JtKHRhc2spLmVuZFRhc2soZXZ0LnJldmVyc2libGVFeGl0KCksIGZhbHNlLCBmYWxzZSk7XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICAgIGNhc2UgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1RCTF9OWFRMSU5FOlxyXG4gICAgICAgICAgICBpZiAoZm9ybSAhPSBudWxsKVxyXG4gICAgICAgICAgICAgIGF3YWl0IGZvcm0ubW92ZUluVmlldyhDb25zdGFudHMuTU9WRV9VTklUX1JPVywgQ29uc3RhbnRzLk1PVkVfRElSRUNUSU9OX05FWFQpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9UQkxfUFJWTElORTpcclxuICAgICAgICAgICAgaWYgKGZvcm0gIT0gbnVsbClcclxuICAgICAgICAgICAgICBhd2FpdCBmb3JtLm1vdmVJblZpZXcoQ29uc3RhbnRzLk1PVkVfVU5JVF9ST1csIENvbnN0YW50cy5NT1ZFX0RJUkVDVElPTl9QUkVWKTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfVEJMX05YVFBBR0U6XHJcbiAgICAgICAgICAgIGlmIChmb3JtICE9IG51bGwpXHJcbiAgICAgICAgICAgICAgYXdhaXQgZm9ybS5tb3ZlSW5WaWV3KENvbnN0YW50cy5NT1ZFX1VOSVRfUEFHRSwgQ29uc3RhbnRzLk1PVkVfRElSRUNUSU9OX05FWFQpO1xyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9UQkxfUF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ZXRMYXN0UGFya2VkQ3RybCgpO1xyXG4gICAgICAgICAgICBpZiAobGFzdFBhcmtlZEN0cmwgPT0gbnVsbCB8fCAhbGFzdFBhcmtlZEN0cmwuaXNMaXN0Qm94KCkpIHtcclxuICAgICAgICAgICAgICBpZiAoZm9ybSAhPSBudWxsKVxyXG4gICAgICAgICAgICAgICAgYXdhaXQgZm9ybS5tb3ZlSW5WaWV3KENvbnN0YW50cy5NT1ZFX1VOSVRfVEFCTEUsIENvbnN0YW50cy5NT1ZFX0RJUkVDVElPTl9CRUdJTik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfVEJMX0VORFRCTDpcclxuICAgICAgICAgICAgLy8gIzkxODU4ODogSWYgY3RybCtob21lL2N0cmwrZW5kIHByZXNzZWQgd2hlbiBwYXJrZWQgb24gbGlzdGJveFxyXG4gICAgICAgICAgICAvLyB0aGVuIEJlZ2luIHRhYmxlIGV2ZW50IHNob3VsZCBub3QgYmUgaGFuZGxlZC5cclxuICAgICAgICAgICAgbGFzdFBhcmtlZEN0cmwgPSA8TWdDb250cm9sPnRhc2suZ2V0TGFzdFBhcmtlZEN0cmwoKTtcclxuICAgICAgICAgICAgaWYgKGxhc3RQYXJrZWRDdHJsID09PSBudWxsIHx8ICFsYXN0UGFya2VkQ3RybC5pc0xpc3RCb3goKSkge1xyXG4gICAgICAgICAgICAgIGlmIChmb3JtICE9IG51bGwpXHJcbiAgICAgICAgICAgICAgICBhd2FpdCBmb3JtLm1vdmVJblZpZXcoQ29uc3RhbnRzLk1PVkVfVU5JVF9UQUJMRSwgQ29uc3RhbnRzLk1PVkVfRElSRUNUSU9OX0VORCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfV0VCX09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cm5hbEludGVyZmFjZS5NR19BQ1RfWk9PTTtcclxuICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgIGlmIChwdXRBY3Rpb24gIT09IEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9OT05FKVxyXG4gICAgICAgICAgICAgICAgdGhpcy5hZGRJbnRlcm5hbEV2ZW50V2l0aEN0cmxBbmRDb2RlKGN0cmwsIHB1dEFjdGlvbik7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgIH1cclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfREVMTElORTpcclxuICAgICAgICAgICAgaWYgKGF3YWl0IHRoaXMuSGFuZGxlQWN0aW9uRGVsbGluZSh0YXNrLCBkdiwgcmVjLCBmYWxzZSkpXHJcbiAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DUkVMSU5FOlxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfQ1JFTElORV9BQk9WRTpcclxuICAgICAgICAgICAgaWYgKHRhc2suRGF0YVZpZXcuaXNFbXB0eURhdGF2aWV3KCkpIHtcclxuICAgICAgICAgICAgICBhd2FpdCB0aGlzLmdvdG9DcmVhdGVNb2RlKHRhc2spO1xyXG5cclxuICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBpZiAodGFzay5nZXRJbkNyZWF0ZUxpbmUoKSlcclxuICAgICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICAgIHRhc2suc2V0SW5DcmVhdGVMaW5lKHRydWUpO1xyXG5cclxuICAgICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgICBpZiAodGFzay5nZXRMZXZlbCgpID09PSBDb25zdGFudHMuVEFTS19MRVZFTF9DT05UUk9MKSB7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLmhhbmRsZUludGVybmFsRXZlbnRXaXRoTWdDb250cm9sQmFzZSh0YXNrLmdldExhc3RQYXJrZWRDdHJsKCksIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DVFJMX1NVRkZJWCk7XHJcbiAgICAgICAgICAgICAgICBpZiAodGhpcy5HZXRTdG9wRXhlY3V0aW9uRmxhZygpKVxyXG4gICAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAvLyB2ZXJpZnkgdGhhdCB0aGUgY3VycmVudCByZWNvcmQgaXMgbm90IGFscmVhZHkgYSBuZXcgb25lXHJcbiAgICAgICAgICAgICAgaWYgKHRhc2suZ2V0TW9kZSgpID09PSBDb25zdGFudHMuVEFTS19NT0RFX0NSRUFURSAmJiByZWMgIT0gbnVsbCAmJiAhcmVjLk1vZGlmaWVkKSB7XHJcbiAgICAgICAgICAgICAgICBpZiAoYXdhaXQgdGFzay5jaGVja1Byb3AoUHJvcEludGVyZmFjZS5QUk9QX1RZUEVfRk9SQ0VfU1VGRklYLCBmYWxzZSkpIHtcclxuICAgICAgICAgICAgICAgICAgZG9TdWZmaXggPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JFQ19TVUZGSVgpO1xyXG4gICAgICAgICAgICAgICAgICBpZiAodGhpcy5HZXRTdG9wRXhlY3V0aW9uRmxhZygpIHx8IHRhc2suaXNBYm9ydGluZygpKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybjtcclxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICAgIHRhc2suc2V0TGV2ZWwoQ29uc3RhbnRzLlRBU0tfTEVWRUxfVEFTSyk7XHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SRUNfUFJFRklYKTtcclxuXHJcbiAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5HZXRTdG9wRXhlY3V0aW9uRmxhZygpICYmIGZvcm0gIT0gbnVsbCkge1xyXG4gICAgICAgICAgICAgICAgICAgIC8vIERlZmVjdCAxNTIzNTU6IFBhcmsgb24gbGFzdFBhcmtlZENvbnRyb2wgaWYgbmV4dFNjcmVlbiBldmVudCBvY2N1cnMgaWYgYWxyZWFkeSBpbiBjcmVhdGUgbW9kZSBhbmQgcmVjb3JkIG5vdCBtb2RpZmllZFxyXG4gICAgICAgICAgICAgICAgICAgIGxldCBsYXN0UGFya2VkQ29udHJvbDogTWdDb250cm9sID0gPE1nQ29udHJvbD50YXNrLmdldExhc3RQYXJrZWRDdHJsKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKGxhc3RQYXJrZWRDb250cm9sICE9PSBudWxsKVxyXG4gICAgICAgICAgICAgICAgICAgICAgYXdhaXQgbGFzdFBhcmtlZENvbnRyb2wuaW52b2tlKCk7XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgcmV0dXJuO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICBsZXQgcmVmRG9TdWZmaXg6IFJlZlBhcmFtPGJvb2xlYW4+ID0gbmV3IFJlZlBhcmFtKGRvU3VmZml4KTtcclxuICAgICAgICAgICAgICBpZiAoYXdhaXQgdGhpcy5Eb1Rhc2tMZXZlbFJlY29yZFN1ZmZpeCh0YXNrLCByZWZEb1N1ZmZpeCkpXHJcbiAgICAgICAgICAgICAgICByZXR1cm47XHJcbiAgICAgICAgICAgICAgZG9TdWZmaXggPSByZWZEb1N1ZmZpeC52YWx1ZTtcclxuXHJcbiAgICAgICAgICAgICAgaWYgKGZvcm0gIT0gbnVsbCkge1xyXG5cclxuICAgICAgICAgICAgICAgIGlmICgodGFzay5nZXRNb2RlKCkgIT09IENvbnN0YW50cy5UQVNLX01PREVfQ1JFQVRFKSB8fCAhdGFzay5Db25maXJtVXBkYXRlTm8pXHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IGZvcm0uYWRkUmVjKGRvU3VmZml4LCBpbnRFdnRDb2RlID09IEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DUkVMSU5FX0FCT1ZFID8gdHJ1ZSA6IGZhbHNlKTtcclxuICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgIGF3YWl0IHRoaXMuRG9UYXNrTGV2ZWxSZWNvcmRQcmVmaXgodGFzayk7XHJcbiAgICAgICAgICAgICAgYXdhaXQgdGhpcy5IYW5kbGVBY3RFbnRlclJvd0VkaXRpbmcodGFzayk7XHJcblxyXG4gICAgICAgICAgICB9IGZpbmFsbHkge1xyXG4gICAgICAgICAgICAgIHRhc2suc2V0SW5DcmVhdGVMaW5lKGZhbHNlKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DQU5DRUw6XHJcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuSGFuZGxlQWN0Q2FuY2VsKGV2dCwgdGFzaywgZm9ybSwgY3RybCwgcmVjLCB0cnVlKTtcclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfRU5URVJfUk9XX0VESVRJTkc6XHJcbiAgICAgICAgICAgIGF3YWl0IHRoaXMuSGFuZGxlQWN0RW50ZXJSb3dFZGl0aW5nKHRhc2spO1xyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgIC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lKTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SVF9SRUZSRVNIX1ZJRVcpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGN0cmwgIT0gbnVsbClcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgY3RybC5pbnZva2UoKTtcclxuICAgICAgICAgICAgICAgIHRhc2suc2V0UHJldmVudFJlY29yZFN1ZmZpeChmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICB0YXNrLnNldFByZXZlbnRDb250cm9sQ2hhbmdlKGZhbHNlKTtcclxuICAgICAgICAgICAgICAgIGlmICghZHYuaXNFbXB0eSgpICYmIChkdi5nZXRDdXJyUmVjKCkpLmdldE1vZGUoKSAhPT0gRGF0YU1vZGlmaWNhdGlvblR5cGVzLkluc2VydClcclxuICAgICAgICAgICAgICAgICAgdGFzay5zZXRNb2RlKENvbnN0YW50cy5UQVNLX01PREVfUVVFUlkpO1xyXG4gICAgICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICAgICAgICB0YXNrLnNldE1vZGUoQ29uc3RhbnRzLlRBU0tfTU9ERV9DUkVBVEUpO1xyXG4gICAgICAgICAgICAgICAgYXdhaXQgZm9ybS5SZWZyZXNoRGlzcGxheShDb25zdGFudHMuVEFTS19SRUZSRVNIX0NVUlJfUkVDKTtcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgdGFzay5zZXRPcmlnaW5hbFRhc2tNb2RlKENvbnN0YW50cy5UQVNLX01PREVfUVVFUlkpO1xyXG4gICAgICAgICAgICAgIGF3YWl0IHRhc2suc2V0Q3JlYXRlRGVsZXRlQWN0c0VuYWJsZVN0YXRlKCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgYnJlYWs7XHJcblxyXG4gICAgICAgICAgY2FzZSBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUlRPX01PRElGWTpcclxuICAgICAgICAgICAgaWYgKHRhc2suZ2V0TW9kZSgpICE9PSBDb25zdGFudHMuVEFTS19NT0RFX01PRElGWSAmJlxyXG4gICAgICAgICAgICAgIChhd2FpdCAodGFzay5nZXRQcm9wKFByb3BJbnRlcmZhY2UuUFJPUF9UWVBFX0FMTE9XX09QVElPTikpLmdldFZhbHVlQm9vbGVhbigpKSA9PT0gZmFsc2UpXHJcbiAgICAgICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgICAgIGF3YWl0IHRhc2suZW5hYmxlTW9kZXMoKTtcclxuICAgICAgICAgICAgb2xkTW9kZSA9IHRhc2suZ2V0T3JpZ2luYWxUYXNrTW9kZSgpO1xyXG4gICAgICAgICAgICBhd2FpdCB0aGlzLmhhbmRsZUludGVybmFsRXZlbnRXaXRoVGFzayh0YXNrLCBJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUkVDX1NVRkZJWCk7XHJcbiAgICAgICAgICAgIGlmICghdGhpcy5HZXRTdG9wRXhlY3V0aW9uRmxhZygpKSB7XHJcbiAgICAgICAgICAgICAgdGFzay5zZXRNb2RlKENvbnN0YW50cy5UQVNLX01PREVfTU9ESUZZKTtcclxuXHJcbiAgICAgICAgICAgICAgaWYgKG9sZE1vZGUgIT09IENvbnN0YW50cy5UQVNLX01PREVfQ1JFQVRFKSB7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCBkdi5jdXJyUmVjQ29tcHV0ZSh0cnVlKTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SRUNfUFJFRklYKTtcclxuICAgICAgICAgICAgICAgIGlmIChjdHJsICE9IG51bGwpXHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IGN0cmwuaW52b2tlKCk7XHJcbiAgICAgICAgICAgICAgfSBlbHNlIHtcclxuICAgICAgICAgICAgICAgIC8vIHdlIGFscmVhZHkgZXhlY3V0ZWQgcmVjb3JkIHN1ZmZpeCAtIHNvIHdlIG5lZWQgdG8gcHJldmVudCB0aGUgdmlldyByZWZyZXNoXHJcbiAgICAgICAgICAgICAgICAvLyBmcm9tIGV4ZWN1dGluZyBpdCBhZ2FpblxyXG4gICAgICAgICAgICAgICAgdGFzay5zZXRQcmV2ZW50UmVjb3JkU3VmZml4KHRydWUpO1xyXG4gICAgICAgICAgICAgICAgdGFzay5zZXRQcmV2ZW50Q29udHJvbENoYW5nZSh0cnVlKTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SVF9SRUZSRVNIX1ZJRVcpO1xyXG4gICAgICAgICAgICAgICAgaWYgKGN0cmwgIT0gbnVsbClcclxuICAgICAgICAgICAgICAgICAgYXdhaXQgY3RybC5pbnZva2UoKTtcclxuICAgICAgICAgICAgICAgIHRhc2suc2V0UHJldmVudFJlY29yZFN1ZmZpeChmYWxzZSk7XHJcbiAgICAgICAgICAgICAgICB0YXNrLnNldFByZXZlbnRDb250cm9sQ2hhbmdlKGZhbHNlKTtcclxuICAgICAgICAgICAgICAgIGlmICghZHYuaXNFbXB0eSgpICYmIChkdi5nZXRDdXJyUmVjKCkpLmdldE1vZGUoKSAhPT0gRGF0YU1vZGlmaWNhdGlvblR5cGVzLkluc2VydClcclxuICAgICAgICAgICAgICAgICAgdGFzay5zZXRNb2RlKENvbnN0YW50cy5UQVNLX01PREVfTU9ESUZZKTtcclxuICAgICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgICAgdGFzay5zZXRNb2RlKENvbnN0YW50cy5UQVNLX01PREVfQ1JFQVRFKTtcclxuICAgICAgICAgICAgICAgIGF3YWl0IGZvcm0uUmVmcmVzaERpc3BsYXkoQ29uc3RhbnRzLlRBU0tfUkVGUkVTSF9DVVJSX1JFQyk7XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIHRhc2suc2V0T3JpZ2luYWxUYXNrTW9kZShDb25zdGFudHMuVEFTS19NT0RFX01PRElGWSk7XHJcbiAgICAgICAgICAgICAgYXdhaXQgdGFzay5zZXRDcmVhdGVEZWxldGVBY3RzRW5hYmxlU3RhdGUoKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBicmVhaztcclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9TRUxFQ1Q6XHJcbiAgICAgICAgICAgIC8qIHByZWZvcm0gcmVjIHN1ZmZpeCAqL1xyXG4gICAgICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICAgIHRhc2suSW5TZWxlY3QgPSB0cnVlO1xyXG4gICAgICAgICAgICAgIGF3YWl0IHRoaXMuaGFuZGxlSW50ZXJuYWxFdmVudFdpdGhUYXNrKHRhc2ssIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9SRUNfU1VGRklYKTtcclxuICAgICAgICAgICAgfSBmaW5hbGx5IHtcclxuICAgICAgICAgICAgICB0YXNrLkluU2VsZWN0ID0gZmFsc2U7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgaWYgKCF0aGlzLl9zdG9wRXhlY3V0aW9uKSB7XHJcbiAgICAgICAgICAgICAgLyogY2xvc2UgdGhlIHNlbGVjdGlvbiBwcm9ncmFtICovXHJcbiAgICAgICAgICAgICAgYXdhaXQgdGhpcy5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX0VYSVQpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGJyZWFrO1xyXG5cclxuXHJcbiAgICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9TVUJGT1JNX1JFRlJFU0g6XHJcbiAgICAg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3JtUmVmcmVzaChzdWJmb3JtVGFzaywgdHJ1ZSk7XHJcbiAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyBpZiBpdCBpcyBTdWJmb3JtUmVmcmVzaCB0aGF0IHJldHVybmVkIGZyb20gdGhlIHNlcnZlciwgc28gc2VhcmNoIHRoZSB0YXNrIGFjY29yZGluZyB0byBpdHMgdGFzayBpZCAodGFnKVxyXG4gICAgICAgICAgICBlbHNlIGlmICgoZXZ0LmdldEFyZ0xpc3QoKSAhPSBudWxsKSAmJiAoZXZ0LmdldEFyZ0xpc3QoKS5nZXRTaXplKCkgPT09IDIpKSB7XHJcbiAgICAgICAgICAgICAgbGV0IHN1YmZvcm1UYXNrOiBUYXNrID0gdGFzaywgcGFyZW50VGFzaztcclxuICAgICAgICAgICAgICBsZXQgdGFza1RhZzogc3RyaW5nID0gYXdhaXQgZXZ0LmdldEFyZ0xpc3QoKS5nZXRBcmdWYWx1ZSgxLCBTdG9yYWdlQXR0cmlidXRlLk5VTUVSSUMsIDApO1xyXG5cclxuICAgICAgICAgICAgICB3aGlsZSAoc3ViZm9ybVRhc2suSXNTdWJGb3JtKSB7XHJcbiAgICAgICAgICAgICAgICBwYXJlbnRUYXNrID0gc3ViZm9ybVRhc2suZ2V0UGFyZW50KCk7XHJcbiAgICAgICAgICAgICAgICBpZiAoc3ViZm9ybVRhc2suZ2V0VGFza1RhZygpID09PSB0YXNrVGFnKSB7XHJcbiAgICAgICAgICAgICAgICAgIGF3YWl0IHBhcmVudFRhc2suU3ViZm9ybVJlZnJlc2goc3ViZm9ybVRhc2ssIHRydWUpO1xyXG4gICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHN1YmZvcm1UYXNrID0gcGFyZW50VGFzaztcclxuICAgICAgICAgICAgICB9XH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V9TVFJfREVMRVRFKTtcclxuICAgICAgICAgICAgaWYgKCFjb25maXJtZWQpIHtcclxuICAgICAgICAgICAgICByZWMuY2xlYXJNb2RlKCk7XHJcbiAgICAgICAgICAgICAgcmVjLnNldE1vZGUob2xkUmVjTW9kZSk7XHJcbiAgICAgICAgICAgICAgdGFzay5zZXRNb2RlKENvbnN0YW50cy5UQVNLX01PREVfTU9ESUZZKTtcclxuICAgICAgICAgICAgICBpZiAobGFzdFBhcmtlZEN0cmwgIT09IG51bGwpXHJcbiAgICAgICAgICAgICAgICBhd2FpdCB0aGlzLmhhbmRsZUludGVybmFsRXZlbnRXaXRoTWdDb250cm9sQmFzZShsYXN0UGFya2VkQ3RybCwgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX0NUUkxfUFJFRklYKTtcclxuXHJcbiAgICAgICAgICAgICAgaWYgKHNhdmVJc1Jvd0VkaXRpbmcpIHtcclxuICAgICAgICAgICAgICAgIGxldCBteWZvcm06IE1nRm9ybSA9IDxNZ0Zvcm0+dGFzay5nZXRGb3JtKCk7XHJcbiAgICAgICAgICAgICAgICBhd2FpdCBteWZvcm0uc3RhcnRSb3dFZGl0aW5nKG15Zm9ybS5EaXNwbGF5TGluZSk7XHJcbiAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG4gICAgICAgIH1cclxuXHJcbiAgICAgICAgYXdhaXQgdGhpcy5oYW5kbGVJbnRlcm5hbEV2ZW50V2l0aFRhc2sodGFzaywgSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1JFQ19TVUZGSVgpO1xyXG4gICAgICAgIHJlYy5zZXRJbkRlbGV0ZVByb2Nlc3MoZmFsc2UpO1xyXG5cclxuICAgICAgICBpZiAodGhpcy5fc3RvcEV4ZWN1dGlvbikge1xyXG4gICAgICAgICAgaWYgKCFyZWMuU2VuZFRvU2VydmVyKSB7XHJ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lzLkhhbmRsZU5vblBhcmthYmxlQ29udHJvbHMoY3RybC5nZXRGb3JtKCkuZ2V0VGFzaygpKTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgfVxyXG5cclxuICAgICAgICAgIGJyZWFrO1xyXG5cclxuICAgICAgICBjYXNlIEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9DVFJMX1NVRkZJWDpcclxuICAgICAgICAgIC8vIGRpc2FibGUgYWN0aW9ucyBhbmQgc3RhdGVzLiBkbyBpdCBvbmx5IGlmIHdlIGFyZSBnZXR0aW5nIG91dCBvZiB0aGUgY29udHJvbC5cclxuICAgICAgICAgIGlmICghdGhpcy5HZXRTdG9wRXhlY3V0aW9uRmxhZygpKSB7XHJcblxyXG4gICAgICAgICAgICBpZiAoY3RybC5pc0Nob2ljZUNvbnRyb2woKSkge1xyXG4gICAgICAgICAgICAgIGN0cmwuU2V0S2V5Ym9hcmRMYW5ndWFnZSgpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIGlmIChjdHJsLlR5cGUgPT09IE1nQ29udHJvbFR5cGUuQ1RSTF9UWVBFX0JVVFRPTilcclxuICAgICAgICAgICAgICB0YXNrLkFjdGlvbk1hbmFnZXIuZW5hYmxlKEludGVybmFsSW50ZXJmYWNlLk1HX0FDVF9CVVRUT04sIGZhbHNlKTtcclxuXHJcbiAgICAgICAgICAgIGlmICh0YXNrLmdldEVuYWJsZVpvb21IYW5kbGVyKCkgfHwgY3RybC51c2Vab29tSGFuZGxlcigpKVxyXG4gICAgICAgICAgICAgIHRhc2suQWN0aW9uTWFuYWdlci5lbmFibGUoSW50ZXJuYWxJbnRlcmZhY2UuTUdfQUNUX1pPT00sIGZhbHNlKTtcclxuICAgICAgICAgICAgdGFzay5BY3Rpb25NYW5hZ2VyLmVuYWJsZShJbnRlcm5hbEludGVyZmFjZS5NR19BQ1RfUlRfRURUX05VTEwsIGZhbHNlKTtcclxuXHJcbiAgICAgICAgICB9XHJcblxyXG4gIC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