@magic-xpa/engine 4.1100.0-dev4110.25 → 4.1100.0-dev4110.252

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