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

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,16 +1,16 @@
1
- import { ApplicationException } from "@magic-xpa/mscorelib";
2
- export var RecordOutOfDataViewException_ExceptionType;
3
- (function (RecordOutOfDataViewException_ExceptionType) {
4
- RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["TOP"] = 0] = "TOP";
5
- RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["BOTTOM"] = 1] = "BOTTOM";
6
- RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["REC_SUFFIX_FAILED"] = 2] = "REC_SUFFIX_FAILED";
7
- RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["NONE"] = 3] = "NONE";
8
- })(RecordOutOfDataViewException_ExceptionType || (RecordOutOfDataViewException_ExceptionType = {}));
9
- export class RecordOutOfDataViewException extends ApplicationException {
10
- constructor(type) {
11
- super((type === RecordOutOfDataViewException_ExceptionType.REC_SUFFIX_FAILED) ? "Record Suffix Failed" :
12
- ("Record out of the " + ((type === RecordOutOfDataViewException_ExceptionType.TOP) ? "top" : "bottom") + " bound of the Data View"));
13
- this.name = "RecordOutOfDataViewException";
14
- }
15
- }
1
+ import { ApplicationException } from "@magic-xpa/mscorelib";
2
+ export var RecordOutOfDataViewException_ExceptionType;
3
+ (function (RecordOutOfDataViewException_ExceptionType) {
4
+ RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["TOP"] = 0] = "TOP";
5
+ RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["BOTTOM"] = 1] = "BOTTOM";
6
+ RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["REC_SUFFIX_FAILED"] = 2] = "REC_SUFFIX_FAILED";
7
+ RecordOutOfDataViewException_ExceptionType[RecordOutOfDataViewException_ExceptionType["NONE"] = 3] = "NONE";
8
+ })(RecordOutOfDataViewException_ExceptionType || (RecordOutOfDataViewException_ExceptionType = {}));
9
+ export class RecordOutOfDataViewException extends ApplicationException {
10
+ constructor(type) {
11
+ super((type === RecordOutOfDataViewException_ExceptionType.REC_SUFFIX_FAILED) ? "Record Suffix Failed" :
12
+ ("Record out of the " + ((type === RecordOutOfDataViewException_ExceptionType.TOP) ? "top" : "bottom") + " bound of the Data View"));
13
+ this.name = "RecordOutOfDataViewException";
14
+ }
15
+ }
16
16
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVjb3JkT3V0T2ZEYXRhVmlld0V4Y2VwdGlvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvZGF0YS9SZWNvcmRPdXRPZkRhdGFWaWV3RXhjZXB0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxvQkFBb0IsRUFBQyxNQUFNLHNCQUFzQixDQUFDO0FBRTFELE1BQU0sQ0FBTixJQUFZLDBDQUtYO0FBTEQsV0FBWSwwQ0FBMEM7SUFDcEQseUdBQUcsQ0FBQTtJQUNILCtHQUFNLENBQUE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y3Rvcih0eXBlOiBSZWNvcmRPdXRPZkRhdGFWaWV3RXhjZXB0aW9uX0V4Y2VwdGlvblR5cGUpIHtcclxuICAgIHN1cGVyKCh0eXBlID09PSBSZWNvcmRPdXRPZkRhdGFWaWV3RXhjZXB0aW9uX0V4Y2VwdGlvblR5cGUuUkVDX1NVRkZJWF9GQUlMRUQpID8gXCJSZWNvcmQgU3VmZml4IEZhaWxlZFwiIDpcclxuICAgICAgKFwiUmVjb3JkIG91dCBvZiB0aGUgXCIgKyAoKHR5cGUgPT09IFJlY29yZE91dE9mRGF0YVZpZXdFeGNlcHRpb25fRXhjZXB0aW9uVHlwZS5UT1ApID8gXCJ0b3BcIiA6IFwiYm90dG9tXCIpICsgXCIgYm91bmQgb2YgdGhlIERhdGEgVmlld1wiKSk7XHJcbiAgICB0aGlzLm5hbWUgPSBcIlJlY29yZE91dE9mRGF0YVZpZXdFeGNlcHRpb25cIjtcclxuICB9XHJcbn1cclxuIl19
@@ -0,0 +1,267 @@
1
+ import { Record } from "./Record";
2
+ import { DataModificationTypes } from "@magic-xpa/gui";
3
+ import { ApplicationException, Hashtable, Int32, List } from "@magic-xpa/mscorelib";
4
+ import { Logger } from "@magic-xpa/utils";
5
+ export class RecordsTable {
6
+ static REC_NOT_FOUND = -1;
7
+ _useLinkedList = false;
8
+ _hashTab = null;
9
+ _initialCurrRecId = Int32.MinValue;
10
+ _records = null;
11
+ _serverCurrRec = null;
12
+ InsertedRecordsCount = 0;
13
+ constructor(withLinkedListOrRecordTable) {
14
+ if (withLinkedListOrRecordTable.constructor === Boolean) {
15
+ this._records = new List();
16
+ this._hashTab = new Hashtable(100, 0.7);
17
+ this._useLinkedList = withLinkedListOrRecordTable;
18
+ this.InsertedRecordsCount = Int32.MinValue;
19
+ }
20
+ else
21
+ Object.assign(this, withLinkedListOrRecordTable);
22
+ }
23
+ fillData(dataview, insertAt, parser) {
24
+ let c = 'N';
25
+ let record = null;
26
+ let flag = false;
27
+ this.InsertedRecordsCount = 0;
28
+ this._initialCurrRecId = Int32.MinValue;
29
+ let nextTag = parser.getNextTag();
30
+ while (nextTag !== null && nextTag === "rec") {
31
+ let record2 = new Record(dataview);
32
+ record2.Initialize();
33
+ let isCurrRec = record2.fillData(parser);
34
+ if (isCurrRec && !dataview.HasMainTable) {
35
+ let dcRefs2;
36
+ let dcRefs = dcRefs2 = record2.getDcRefs();
37
+ try {
38
+ for (let i = 0; i < this.getSize(); i = i + 1) {
39
+ this.getRecByIdx(i).setDcRefs(dcRefs);
40
+ }
41
+ }
42
+ finally {
43
+ if (dcRefs2 !== null) {
44
+ (dcRefs2).Dispose();
45
+ }
46
+ }
47
+ }
48
+ if (isCurrRec) {
49
+ if (dataview.getTask().getMode() !== 'C') {
50
+ record2.setOldRec();
51
+ }
52
+ this._initialCurrRecId = record2.getId();
53
+ this._serverCurrRec = record2.replicate();
54
+ if (c === 'N') {
55
+ c = 'C';
56
+ }
57
+ else {
58
+ c = 'F';
59
+ }
60
+ }
61
+ else {
62
+ record2.setOldRec();
63
+ c = 'T';
64
+ }
65
+ let foundRec = this.getRecord(record2.getId());
66
+ if (foundRec !== null) {
67
+ let updated = foundRec.Updated;
68
+ let modified = foundRec.Modified;
69
+ let computed = foundRec.isComputed();
70
+ let prevRec = foundRec.getPrevRec();
71
+ let nextRec = foundRec.getNextRec();
72
+ foundRec.setSameAs(record2, false);
73
+ foundRec.setPrevRec(prevRec);
74
+ foundRec.setNextRec(nextRec);
75
+ foundRec.setComputed(computed);
76
+ if (modified)
77
+ foundRec.setModified();
78
+ if (updated)
79
+ foundRec.setUpdated();
80
+ }
81
+ else {
82
+ this.InsertRecord(insertAt, record2);
83
+ if (dataview.getTask().isTableWithAbsolutesScrollbar()) {
84
+ if (dataview.TotalRecordsCount === 0 && dataview.RecordsBeforeCurrentView == 0)
85
+ dataview.TotalRecordsCount = dataview.TotalRecordsCount + 1;
86
+ if (dataview.RecordsBeforeCurrentView > 0 && insertAt === 'B')
87
+ dataview.RecordsBeforeCurrentView = dataview.RecordsBeforeCurrentView - 1;
88
+ }
89
+ if (isCurrRec && dataview.getTask().getMode() === 'C')
90
+ record2.setMode(DataModificationTypes.Insert);
91
+ record2.setComputed(true);
92
+ }
93
+ nextTag = parser.getNextTag();
94
+ if (!isCurrRec)
95
+ record = record2;
96
+ flag = true;
97
+ }
98
+ let num = 0;
99
+ while (!dataview.HasMainTable && record !== null && num < dataview.getChunkSize() - 1) {
100
+ let record4 = new Record(dataview);
101
+ record4.Initialize();
102
+ record4.setSameAs(record, false, record.getId() + num + 1);
103
+ record4.setOldRec();
104
+ this.addRec(record4);
105
+ num = num + 1;
106
+ }
107
+ if (this._initialCurrRecId === Int32.MinValue) {
108
+ if (flag)
109
+ this._serverCurrRec = null;
110
+ else {
111
+ if (dataview.getCurrRec() !== null)
112
+ this._serverCurrRec = (dataview.getCurrRec()).replicate();
113
+ else
114
+ this._serverCurrRec = null;
115
+ }
116
+ }
117
+ return c;
118
+ }
119
+ InsertRecord(insertAt, record) {
120
+ if (insertAt === 'B') {
121
+ let insertedRecordsCount = this.InsertedRecordsCount;
122
+ this.InsertedRecordsCount = insertedRecordsCount + 1;
123
+ this.insertRecord(record, 0);
124
+ }
125
+ else
126
+ this.addRec(record);
127
+ }
128
+ buildXML(message, skipCurrRec, currRecId) {
129
+ for (let i = 0; i < this._records.length; i = i + 1) {
130
+ let record = this._records.get_Item(i);
131
+ if (!record.SendToServer || (skipCurrRec && record.getId() === currRecId))
132
+ continue;
133
+ let prevRec;
134
+ let record2 = prevRec = record.getPrevRec();
135
+ let recIdx;
136
+ while (prevRec !== null && typeof prevRec !== "undefined" &&
137
+ (prevRec.getMode() === DataModificationTypes.Insert || !prevRec.SendToServer) &&
138
+ record.getMode() === DataModificationTypes.Insert &&
139
+ ((recIdx = this.getRecIdx(prevRec.getId())) > i || recIdx === RecordsTable.REC_NOT_FOUND || !prevRec.SendToServer)) {
140
+ prevRec = prevRec.getPrevRec();
141
+ record.setPrevRec(prevRec);
142
+ }
143
+ record.buildXML(message, false);
144
+ if (prevRec !== record2) {
145
+ record.setPrevRec(record2);
146
+ }
147
+ }
148
+ }
149
+ getRecord(id) {
150
+ return this._hashTab.get_Item(id);
151
+ }
152
+ getRecIdx(id) {
153
+ let result = RecordsTable.REC_NOT_FOUND;
154
+ let record = this.getRecord(id);
155
+ if (record !== null) {
156
+ result = this._records.indexOf(record);
157
+ }
158
+ return result;
159
+ }
160
+ getRecByIdx(idx) {
161
+ if (idx < 0 || idx >= this._records.length) {
162
+ Logger.Instance.WriteDevToLog("in RecordsTable.getRecByIdx() index out of bounds: " + idx);
163
+ return null;
164
+ }
165
+ return this._records.get_Item(idx);
166
+ }
167
+ removeAll() {
168
+ this._records.Clear();
169
+ this._hashTab.Clear();
170
+ }
171
+ getSize() {
172
+ return this._records.length;
173
+ }
174
+ getInitialCurrRecId() {
175
+ return this._initialCurrRecId;
176
+ }
177
+ addRecord(rec) {
178
+ if (this._records.indexOf(rec) < 0) {
179
+ this.addRec(rec);
180
+ }
181
+ }
182
+ addRec(rec) {
183
+ if (this._useLinkedList && this._records.length > 0) {
184
+ let record = this._records.get_Item(this._records.length - 1);
185
+ record.setNextRec(rec);
186
+ rec.setPrevRec(record);
187
+ }
188
+ this._records.push(rec);
189
+ this._hashTab.set_Item(rec.getHashKey(), rec);
190
+ }
191
+ insertRecord(rec, idx) {
192
+ if (this._useLinkedList) {
193
+ if (idx > 0) {
194
+ let record = this._records.get_Item(idx - 1);
195
+ rec.setPrevRec(record);
196
+ record.setNextRec(rec);
197
+ }
198
+ if (idx !== this._records.length) {
199
+ let record2 = this._records.get_Item(idx);
200
+ rec.setNextRec(record2);
201
+ record2.setPrevRec(rec);
202
+ }
203
+ }
204
+ this._records.Insert(idx, rec);
205
+ this._hashTab.set_Item(rec.getHashKey(), rec);
206
+ }
207
+ removeRecord(recIdxOrRec) {
208
+ if (arguments.length === 1 && (recIdxOrRec === null || recIdxOrRec.constructor === Number)) {
209
+ this.removeRecord_0(recIdxOrRec);
210
+ return;
211
+ }
212
+ this.removeRecord_1(recIdxOrRec);
213
+ }
214
+ removeRecord_0(recIdx) {
215
+ if (recIdx >= 0 && recIdx < this._records.length) {
216
+ let record = this._records.get_Item(recIdx);
217
+ let useLinkedList = this._useLinkedList;
218
+ if (useLinkedList) {
219
+ if (recIdx > 0) {
220
+ let record2 = this._records.get_Item(recIdx - 1);
221
+ record2.setNextRec(record.getNextRec());
222
+ }
223
+ if (recIdx + 1 < this._records.length) {
224
+ let record2 = this._records.get_Item(recIdx + 1);
225
+ record2.setPrevRec(record.getPrevRec());
226
+ }
227
+ }
228
+ this._hashTab.Remove(record.getHashKey());
229
+ this._records.RemoveAt(recIdx);
230
+ return;
231
+ }
232
+ throw new ApplicationException("in RecordsTable.removeRecord(): invalid index: " + recIdx);
233
+ }
234
+ removeRecord_1(rec) {
235
+ let num = this._records.indexOf(rec);
236
+ if (num >= 0) {
237
+ this.removeRecord(num);
238
+ }
239
+ }
240
+ replicate() {
241
+ let recordsTable = new RecordsTable(this);
242
+ recordsTable._records = new List();
243
+ recordsTable._hashTab = new Hashtable(100, 0.7);
244
+ for (let i = 0; i < this._records.length; i = i + 1) {
245
+ let record = this._records.get_Item(i).replicate();
246
+ recordsTable._records.push(record);
247
+ recordsTable._hashTab.set_Item(record.getHashKey(), record);
248
+ }
249
+ return recordsTable;
250
+ }
251
+ getServerCurrRec() {
252
+ return this._serverCurrRec;
253
+ }
254
+ zeroServerCurrRec() {
255
+ this._serverCurrRec = null;
256
+ }
257
+ GetSize() {
258
+ return this.getSize();
259
+ }
260
+ GetRecByIdx(idx) {
261
+ return this.getRecByIdx(idx);
262
+ }
263
+ RemoveAll() {
264
+ this.removeAll();
265
+ }
266
+ }
267
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVjb3Jkc1RhYmxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZW5naW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JlYygpOiB2b2lkIHtcclxuICAgIHRoaXMuX3NlcnZlckN1cnJSZWMgPSBudWxsO1xyXG4gIH1cclxuXHJcbiAgLy8vIDxzdW1tYXJ5PlxyXG4gIC8vL1xyXG4gIC8vLyA8L3N1bW1hcnk+XHJcbiAgLy8vIDxyZXR1cm5zPjwvcmV0dXJucz5cclxuICBHZXRTaXplKCk6IG51bWJlciB7XHJcbiAgICByZXR1cm4gdGhpcy5nZXRTaXplKCk7XHJcbiAgfVxyXG5cclxuICBHZXRSZWNCeUlkeChpZHg6IG51bWJlcik6IFJlY29yZCB7XHJcbiAgICByZXR1cm4gdGhpcy5nZXRSZWNCeUlkeChpZHgpO1xyXG4gIH1cclxuXHJcbiAgUmVtb3ZlQWxsKCk6IHZvaWQge1xyXG4gICAgdGhpcy5yZW1vdmVBbGwoKTtcclxuICB9XHJcbn1cclxuIl19
@@ -0,0 +1,107 @@
1
+ import { PropInterface } from "@magic-xpa/gui";
2
+ import { Transaction } from "../rt/Transaction";
3
+ import { ReturnResult } from "../util/ReturnResult";
4
+ import { DataViewCommandType } from "../commands/ClientToServer/DataviewCommand";
5
+ import { CommandsProcessorBase_SendingInstruction } from "../CommandsProcessorBase";
6
+ import { CommandFactory } from "../commands/ClientToServer/CommandFactory";
7
+ import { ConstInterface } from "../ConstInterface";
8
+ import { RefParam } from "@magic-xpa/mscorelib";
9
+ import { RemoteCommandsProcessor } from "../remote/RemoteCommandsProcessor";
10
+ import { MGDataCollection } from "../tasks/MGDataCollection";
11
+ export class TaskTransactionManager {
12
+ task = null;
13
+ get isClosingTopmostTask() {
14
+ return MGDataCollection.Instance.StartupMgData.getFirstTask().InEndTask;
15
+ }
16
+ constructor(task) {
17
+ this.task = task;
18
+ }
19
+ AllowTransaction(transBegin, forLocal) {
20
+ let result;
21
+ if (forLocal)
22
+ result = (transBegin === ConstInterface.TRANS_TASK_PREFIX || transBegin === ConstInterface.TRANS_RECORD_PREFIX);
23
+ else
24
+ result = (transBegin === ConstInterface.TRANS_TASK_PREFIX || transBegin === ConstInterface.TRANS_RECORD_PREFIX || transBegin === ConstInterface.TRANS_NONE);
25
+ return result;
26
+ }
27
+ PrepareTransactionProperties(transaction, forLocal) {
28
+ let transactionBeginValue = this.GetTransactionBeginValue(forLocal);
29
+ let flag = transaction !== null && this.AllowTransaction(transactionBeginValue, forLocal);
30
+ if (flag)
31
+ transaction.setTransBegin(transactionBeginValue);
32
+ }
33
+ GetTransactionBeginValue(forLocal) {
34
+ let result = ConstInterface.TRANS_NONE;
35
+ let prop = this.task.getProp(PropInterface.PROP_TYPE_TRASACTION_BEGIN);
36
+ if (prop !== null) {
37
+ let propgetValue = forLocal ? prop.StudioValue : prop.GetComputedValue();
38
+ if (propgetValue !== null) {
39
+ result = propgetValue.charAt(0);
40
+ }
41
+ }
42
+ return result;
43
+ }
44
+ async checkAndCommit(reversibleExit, level, isAbort) {
45
+ let oper = isAbort ? ConstInterface.TRANS_ABORT : ConstInterface.TRANS_COMMIT;
46
+ let result = await this.ExecuteLocalUpdatesCommand();
47
+ if (!result.Success) {
48
+ if (!this.task.IsInteractive)
49
+ this.task.abort();
50
+ return false;
51
+ }
52
+ let refResult = new RefParam(result);
53
+ let ret = await this.checkAndCommitPerDataview(this.task.DataviewManager.RemoteDataviewManager, reversibleExit, level, oper, refResult);
54
+ result = refResult.value;
55
+ if (!ret) {
56
+ if (level === ConstInterface.TRANS_RECORD_PREFIX && this.task.DataView.modifiedRecordsNumber() > 0 && this.task.DataView.FlushUpdates) {
57
+ try {
58
+ this.task.TryingToCommit = true;
59
+ await RemoteCommandsProcessor.GetInstance().Execute(CommandsProcessorBase_SendingInstruction.TASKS_AND_COMMANDS);
60
+ }
61
+ finally {
62
+ this.task.TryingToCommit = false;
63
+ }
64
+ }
65
+ }
66
+ return false;
67
+ }
68
+ async ExecuteLocalUpdatesCommand() {
69
+ let command = CommandFactory.CreateDataViewCommand(this.task.getTaskTag(), DataViewCommandType.ExecuteLocalUpdates);
70
+ return await this.task.DataviewManager.Execute(command);
71
+ }
72
+ async checkAndCommitPerDataview(dataviewmanager, reversibleExit, level, oper, refResult) {
73
+ refResult.value = new ReturnResult();
74
+ let returnValue = false;
75
+ let currentTransaction = dataviewmanager.Transaction;
76
+ if (currentTransaction !== null && !this.task.isAborting() &&
77
+ currentTransaction.isOpened() && currentTransaction.isOwner(this.task) &&
78
+ currentTransaction.getLevel() === level) {
79
+ let updatedFields = '';
80
+ let currRec = this.task.DataView.getCurrRec();
81
+ if (currentTransaction.getLevel() === "P")
82
+ updatedFields = currRec.getUpdatedFields();
83
+ let cmd = CommandFactory.CreateTransactionCommand(oper, this.task.getTaskTag(), reversibleExit, level, updatedFields);
84
+ if (this.isClosingTopmostTask && MGDataCollection.Instance.StartupMgData.getFirstTask().ClosingFormUI)
85
+ this.task.getMGData().CmdsToServer.Add(cmd);
86
+ try {
87
+ this.task.TryingToCommit = true;
88
+ if (!(this.isClosingTopmostTask && MGDataCollection.Instance.StartupMgData.getFirstTask().ClosingFormUI))
89
+ refResult.value = await dataviewmanager.Execute(cmd);
90
+ }
91
+ finally {
92
+ this.task.TryingToCommit = false;
93
+ }
94
+ returnValue = true;
95
+ }
96
+ return returnValue;
97
+ }
98
+ HandelTransactionErrorHandlingsRetry(transBegin) {
99
+ let task = this.task;
100
+ if (task.Transaction === null && transBegin[0] === ConstInterface.TRANS_NONE) {
101
+ task.TransactionErrorHandlingsRetry = new Transaction(task, task.getTaskTag());
102
+ task.TransactionErrorHandlingsRetry.setTransBegin(ConstInterface.TRANS_RECORD_PREFIX);
103
+ transBegin[0] = ConstInterface.TRANS_RECORD_PREFIX;
104
+ }
105
+ }
106
+ }
107
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVGFza1RyYW5zYWN0aW9uTWFuYWdlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2VuZ2luZS9zcmMvZGF0Y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2V0VGFza1RhZygpKTtcclxuICAgICAgdGFzay5UcmFuc2FjdGlvbkVycm9ySGFuZGxpbmdzUmV0cnkuc2V0VHJhbnNCZWdpbihDb25zdEludGVyZmFjZS5UUkFOU19SRUNPUkRfUFJFRklYKTtcclxuICAgICAgdHJhbnNCZWdpblswXSA9IENvbnN0SW50ZXJmYWNlLlRSQU5TX1JFQ09SRF9QUkVGSVg7XHJcbiAgICB9XHJcbiAgfVxyXG59XHJcbiJdfQ==
@@ -0,0 +1,74 @@
1
+ import { DcValuesBuilderBase } from "@magic-xpa/gui";
2
+ import { Logger, StorageAttribute, XMLConstants, XmlParser } from "@magic-xpa/utils";
3
+ import { ConstInterface } from "../ConstInterface";
4
+ import { Environment } from "../env/Environment";
5
+ export class XMLBasedDcValuesBuilder extends DcValuesBuilderBase {
6
+ dcv = null;
7
+ parser = null;
8
+ set SerializedDCVals(value) {
9
+ this.parser.setXMLdata(value);
10
+ this.parser.setCurrIndex(0);
11
+ }
12
+ constructor() {
13
+ super();
14
+ this.parser = new XmlParser();
15
+ }
16
+ Build() {
17
+ this.dcv = null;
18
+ let endContext = this.parser.getXMLdata().indexOf(XMLConstants.TAG_TERM, this.parser.getCurrIndex());
19
+ if (endContext !== -1 && endContext < this.parser.getXMLdata().length) {
20
+ let tag = this.parser.getXMLsubstring(endContext);
21
+ this.parser.add2CurrIndex(tag.indexOf(ConstInterface.MG_TAG_DC_VALS) + ConstInterface.MG_TAG_DC_VALS.length);
22
+ let tokensVector = XmlParser.getTokens(this.parser.getXMLsubstring(endContext), XMLConstants.XML_ATTR_DELIM);
23
+ this.dcv = this.CreateDcValues();
24
+ this.InitDCValues(this.dcv, tokensVector);
25
+ }
26
+ return this.dcv;
27
+ }
28
+ InitDCValues(dcv, tokensVector) {
29
+ let type = StorageAttribute.NONE;
30
+ let displayValues = null;
31
+ let serializedLinkValues = null;
32
+ for (let j = 0; j < tokensVector.length; j += 2) {
33
+ let attribute = (tokensVector.get_Item(j));
34
+ let valueStr = (tokensVector.get_Item(j + 1));
35
+ switch (attribute) {
36
+ case XMLConstants.MG_ATTR_ID:
37
+ this.SetId(dcv, XmlParser.getInt(valueStr));
38
+ break;
39
+ case XMLConstants.MG_ATTR_TYPE:
40
+ type = valueStr[0];
41
+ this.SetType(dcv, type);
42
+ break;
43
+ case ConstInterface.MG_ATTR_DISP:
44
+ valueStr = XmlParser.unescape(valueStr);
45
+ displayValues = this.ParseValues(valueStr, StorageAttribute.UNICODE);
46
+ break;
47
+ case ConstInterface.MG_ATTR_LINKED:
48
+ valueStr = XmlParser.unescape(valueStr);
49
+ serializedLinkValues = valueStr;
50
+ break;
51
+ case ConstInterface.MG_ATTR_NULL_FLAGS:
52
+ this.SetNullFlags(dcv, valueStr);
53
+ break;
54
+ default:
55
+ Logger.Instance.WriteExceptionToLogWithMsg("in DcValues.initElements() unknown attribute: " + attribute);
56
+ break;
57
+ }
58
+ }
59
+ this.SetDisplayValues(dcv, displayValues);
60
+ if (serializedLinkValues == null)
61
+ this.SetLinkValues(dcv, displayValues);
62
+ else
63
+ this.SetLinkValues(dcv, this.ParseValues(serializedLinkValues, type));
64
+ }
65
+ ParseValues(valueStr, dataType) {
66
+ let useHex = false;
67
+ if (Environment.Instance.GetDebugLevel() > 1 ||
68
+ dataType === StorageAttribute.ALPHA || dataType === StorageAttribute.UNICODE || dataType === StorageAttribute.BOOLEAN) {
69
+ useHex = true;
70
+ }
71
+ return super.ParseValues(valueStr, dataType, useHex);
72
+ }
73
+ }
74
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiWE1MQmFzZWREY1ZhbHVlc0J1aWxkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9lbmdpbmUvc3JjL2RhdGEvWE1MQmFzZWREY1ZhbHVlc0J1aWxkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyx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