@magic-xpa/engine 4.1100.0-dev4110.98 → 4.1100.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (492) hide show
  1. package/README.md +7 -7
  2. package/{esm2020 → esm2022}/index.mjs +188 -188
  3. package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
  4. package/esm2022/src/AccessHelper.mjs +15 -0
  5. package/esm2022/src/ClientManager.mjs +421 -0
  6. package/esm2022/src/CommandsProcessorBase.mjs +56 -0
  7. package/{esm2020 → esm2022}/src/CommandsProcessorManager.mjs +25 -25
  8. package/esm2022/src/CommandsTable.mjs +162 -0
  9. package/esm2022/src/ConstInterface.mjs +517 -0
  10. package/{esm2020 → esm2022}/src/CurrentClientVersion.mjs +2 -2
  11. package/esm2022/src/FlowMonitorInterface.mjs +16 -0
  12. package/esm2022/src/GUIManager.mjs +62 -0
  13. package/esm2022/src/GlobalCommandsManager.mjs +34 -0
  14. package/esm2022/src/GuiEventsProcessor.mjs +156 -0
  15. package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
  16. package/esm2022/src/ServerConfig.mjs +122 -0
  17. package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
  18. package/esm2022/src/bridge/MagicBridge.mjs +41 -0
  19. package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
  20. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
  21. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
  22. package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
  23. package/esm2022/src/commands/ClientToServer/BrowserEscEventCommand.mjs +26 -0
  24. package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
  25. package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +59 -59
  26. package/esm2022/src/commands/ClientToServer/ColumnSortEventCommand.mjs +29 -0
  27. package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +261 -0
  28. package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
  29. package/esm2022/src/commands/ClientToServer/ComputeEventCommand.mjs +26 -0
  30. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +24 -21
  31. package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +23 -20
  32. package/{esm2020 → esm2022}/src/commands/ClientToServer/ControlItemsRefreshCommand.mjs +8 -8
  33. package/esm2022/src/commands/ClientToServer/DataViewOutputCommand.mjs +13 -0
  34. package/{esm2020 → esm2022}/src/commands/ClientToServer/DataviewCommand.mjs +44 -44
  35. package/esm2022/src/commands/ClientToServer/EvaluateCommand.mjs +40 -0
  36. package/{esm2020 → esm2022}/src/commands/ClientToServer/EventCommand.mjs +43 -40
  37. package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +70 -0
  38. package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +25 -0
  39. package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
  40. package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
  41. package/esm2022/src/commands/ClientToServer/IndexChangeEventCommand.mjs +24 -0
  42. package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +26 -0
  43. package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +26 -23
  44. package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
  45. package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +30 -0
  46. package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +30 -0
  47. package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +27 -0
  48. package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +43 -0
  49. package/esm2022/src/commands/ClientToServer/SelectProgramCommand.mjs +19 -0
  50. package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
  51. package/esm2022/src/commands/ClientToServer/SubformOpenEventCommand.mjs +24 -0
  52. package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +27 -0
  53. package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +34 -0
  54. package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +18 -15
  55. package/esm2022/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +18 -0
  56. package/esm2022/src/commands/DataViewCommandBase.mjs +8 -0
  57. package/{esm2020 → esm2022}/src/commands/IClientCommand.mjs +1 -1
  58. package/esm2022/src/commands/IClientTargetedCommand.mjs +13 -0
  59. package/{esm2020 → esm2022}/src/commands/IClientToServerCommandInfo.mjs +2 -2
  60. package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
  61. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
  62. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddRangeCommand.mjs +62 -62
  63. package/{esm2020 → esm2022}/src/commands/ServerToClient/AddSortCommand.mjs +33 -33
  64. package/esm2022/src/commands/ServerToClient/ClientRefreshCommand.mjs +25 -0
  65. package/esm2022/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +24 -0
  66. package/esm2022/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +45 -0
  67. package/esm2022/src/commands/ServerToClient/OpenURLCommand.mjs +221 -0
  68. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetLocateCommand.mjs +14 -14
  69. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetRangeCommand.mjs +14 -14
  70. package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetSortCommand.mjs +14 -14
  71. package/esm2022/src/commands/ServerToClient/ResultCommand.mjs +37 -0
  72. package/esm2022/src/commands/ServerToClient/VerifyCommand.mjs +83 -0
  73. package/{esm2020 → esm2022}/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -132
  74. package/{esm2020 → esm2022}/src/communications/IConnectionStateManager.mjs +1 -1
  75. package/esm2022/src/communications/InteractiveCommunicationsFailureHandler.mjs +15 -0
  76. package/{esm2020 → esm2022}/src/data/DataSourceIdKey.mjs +2 -2
  77. package/esm2022/src/data/DataView.mjs +1613 -0
  78. package/{esm2020 → esm2022}/src/data/DataViewBase.mjs +3 -3
  79. package/esm2022/src/data/DataviewManager.mjs +28 -0
  80. package/esm2022/src/data/DataviewManagerBase.mjs +15 -0
  81. package/esm2022/src/data/DvCache.mjs +67 -0
  82. package/esm2022/src/data/Field.mjs +646 -0
  83. package/esm2022/src/data/FieldBase.mjs +15 -0
  84. package/esm2022/src/data/FieldsTable.mjs +103 -0
  85. package/{esm2020 → esm2022}/src/data/IRecordsTable.mjs +1 -1
  86. package/{esm2020 → esm2022}/src/data/Key.mjs +88 -88
  87. package/esm2022/src/data/Record.mjs +880 -0
  88. package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
  89. package/esm2022/src/data/RecordsTable.mjs +267 -0
  90. package/{esm2020 → esm2022}/src/data/TaskTransactionManager.mjs +107 -103
  91. package/{esm2020 → esm2022}/src/data/XMLBasedDcValuesBuilder.mjs +74 -74
  92. package/{esm2020 → esm2022}/src/enums.mjs +23 -23
  93. package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
  94. package/esm2022/src/env/Environment.mjs +487 -0
  95. package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
  96. package/esm2022/src/env/LanguageData.mjs +227 -0
  97. package/{esm2020 → esm2022}/src/env/MirrorString.mjs +65 -65
  98. package/esm2022/src/event/ActionManager.mjs +91 -0
  99. package/esm2022/src/event/Event.mjs +1333 -0
  100. package/esm2022/src/event/EventHandler.mjs +766 -0
  101. package/esm2022/src/event/EventHandlerPosition.mjs +204 -0
  102. package/esm2022/src/event/EventsManager.mjs +2988 -0
  103. package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
  104. package/esm2022/src/event/RunTimeEvent.mjs +399 -0
  105. package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
  106. package/esm2022/src/event/UserEventsTable.mjs +47 -0
  107. package/esm2022/src/exp/ExpTable.mjs +57 -0
  108. package/esm2022/src/exp/Expression.mjs +200 -0
  109. package/esm2022/src/exp/ExpressionDict.mjs +727 -0
  110. package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
  111. package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
  112. package/{esm2020 → esm2022}/src/exp/GlobalParamsTable.mjs +85 -85
  113. package/esm2022/src/exp/YesNoExp.mjs +36 -0
  114. package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
  115. package/esm2022/src/gui/FormsTable.mjs +66 -0
  116. package/esm2022/src/gui/MgControl.mjs +363 -0
  117. package/esm2022/src/gui/MgForm.mjs +1224 -0
  118. package/esm2022/src/http/HttpManager.mjs +97 -0
  119. package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
  120. package/{esm2020 → esm2022}/src/http/client/HttpClientBase.mjs +132 -132
  121. package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
  122. package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
  123. package/esm2022/src/http/client/HttpUtility.mjs +84 -0
  124. package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
  125. package/{esm2020 → esm2022}/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -18
  126. package/{esm2020 → esm2022}/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -18
  127. package/{esm2020 → esm2022}/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -18
  128. package/esm2022/src/remote/RemoteCommandsProcessor.mjs +883 -0
  129. package/{esm2020 → esm2022}/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -25
  130. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandBase.mjs +24 -24
  131. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandFactory.mjs +60 -60
  132. package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
  133. package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
  134. package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
  135. package/{esm2020 → esm2022}/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +16 -16
  136. package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
  137. package/{esm2020 → esm2022}/src/remote/ResetUserSortRemoteDataviewCommand.mjs +15 -15
  138. package/esm2022/src/remote/ServerError.mjs +40 -0
  139. package/{esm2020 → esm2022}/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +19 -19
  140. package/esm2022/src/rt/Argument.mjs +265 -0
  141. package/esm2022/src/rt/ArgumentsList.mjs +103 -0
  142. package/esm2022/src/rt/Boundary.mjs +152 -0
  143. package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
  144. package/esm2022/src/rt/DataviewHeaderBase.mjs +98 -0
  145. package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
  146. package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
  147. package/{esm2020 → esm2022}/src/rt/DataviewHeadersSaxHandler.mjs +38 -38
  148. package/{esm2020 → esm2022}/src/rt/ExecutionStack.mjs +94 -94
  149. package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
  150. package/{esm2020 → esm2022}/src/rt/HandlersTable.mjs +96 -96
  151. package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
  152. package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
  153. package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
  154. package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
  155. package/esm2022/src/rt/Operation.mjs +735 -0
  156. package/esm2022/src/rt/OperationTable.mjs +67 -0
  157. package/esm2022/src/rt/Recompute.mjs +355 -0
  158. package/{esm2020 → esm2022}/src/rt/RecomputeTable.mjs +62 -62
  159. package/{esm2020 → esm2022}/src/rt/RemoteDataviewHeader.mjs +108 -108
  160. package/esm2022/src/rt/ResultValue.mjs +10 -0
  161. package/esm2022/src/rt/TableCache.mjs +177 -0
  162. package/esm2022/src/rt/TableCacheManager.mjs +67 -0
  163. package/esm2022/src/rt/Transaction.mjs +53 -0
  164. package/esm2022/src/security/UserDetails.mjs +71 -0
  165. package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
  166. package/esm2022/src/tasks/MGData.mjs +552 -0
  167. package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
  168. package/esm2022/src/tasks/RCTimer.mjs +63 -0
  169. package/{esm2020 → esm2022}/src/tasks/RemoteTaskService.mjs +44 -44
  170. package/esm2022/src/tasks/Task.mjs +2499 -0
  171. package/esm2022/src/tasks/TaskBase.mjs +83 -0
  172. package/{esm2020 → esm2022}/src/tasks/TaskServiceBase.mjs +24 -24
  173. package/esm2022/src/tasks/TasksTable.mjs +80 -0
  174. package/esm2022/src/tasks/sort/Sort.mjs +5 -0
  175. package/{esm2020 → esm2022}/src/tasks/sort/SortCollection.mjs +67 -67
  176. package/{esm2020 → esm2022}/src/util/ConstUtils.mjs +13 -13
  177. package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
  178. package/{esm2020 → esm2022}/src/util/HeapSort.mjs +69 -69
  179. package/{esm2020 → esm2022}/src/util/IMirrorXML.mjs +1 -1
  180. package/{esm2020 → esm2022}/src/util/IServerConfig.mjs +1 -1
  181. package/{esm2020 → esm2022}/src/util/MgBlockingQueue.mjs +1 -1
  182. package/esm2022/src/util/MgPriorityBlockingQueue.mjs +74 -0
  183. package/esm2022/src/util/MgPriorityQueue.mjs +66 -0
  184. package/{esm2020 → esm2022}/src/util/ParamParseResult.mjs +7 -7
  185. package/esm2022/src/util/PrmMap.mjs +152 -0
  186. package/esm2022/src/util/ReturnResult.mjs +46 -0
  187. package/esm2022/src/util/ReturnResultBase.mjs +18 -0
  188. package/esm2022/src/util/Scrambler.mjs +89 -0
  189. package/esm2022/src/util/UniqueIDUtils.mjs +13 -0
  190. package/{esm2020 → esm2022}/src/util/cookie.service.mjs +92 -92
  191. package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29888 -29690
  192. package/fesm2022/magic-xpa-engine.mjs.map +1 -0
  193. package/index.d.ts +187 -187
  194. package/package.json +8 -14
  195. package/src/AccessHelper.d.ts +20 -20
  196. package/src/ClientManager.d.ts +35 -32
  197. package/src/CommandsProcessorBase.d.ts +23 -23
  198. package/src/CommandsProcessorManager.d.ts +6 -6
  199. package/src/CommandsTable.d.ts +22 -22
  200. package/src/ConstInterface.d.ts +516 -515
  201. package/src/CurrentClientVersion.d.ts +1 -1
  202. package/src/FlowMonitorInterface.d.ts +15 -15
  203. package/src/GUIManager.d.ts +17 -17
  204. package/src/GlobalCommandsManager.d.ts +17 -17
  205. package/src/GuiEventsProcessor.d.ts +24 -24
  206. package/src/ICommandsTable.d.ts +9 -9
  207. package/src/ServerConfig.d.ts +35 -34
  208. package/src/bridge/IGuiEvent.d.ts +19 -19
  209. package/src/bridge/MagicBridge.d.ts +16 -16
  210. package/src/commands/ClientOriginatedCommandTaskTag.d.ts +8 -8
  211. package/src/commands/ClientToServer/AddUserLocateDataViewCommand.d.ts +4 -4
  212. package/src/commands/ClientToServer/AddUserRangeDataviewCommand.d.ts +6 -6
  213. package/src/commands/ClientToServer/AddUserSortDataViewCommand.d.ts +6 -6
  214. package/src/commands/ClientToServer/BrowserEscEventCommand.d.ts +9 -8
  215. package/src/commands/ClientToServer/ClientOriginatedCommand.d.ts +8 -8
  216. package/src/commands/ClientToServer/ClientOriginatedCommandSerializer.d.ts +6 -6
  217. package/src/commands/ClientToServer/ColumnSortEventCommand.d.ts +11 -10
  218. package/src/commands/ClientToServer/CommandFactory.d.ts +64 -64
  219. package/src/commands/ClientToServer/CommandSerializationHelper.d.ts +20 -20
  220. package/src/commands/ClientToServer/ComputeEventCommand.d.ts +9 -8
  221. package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +8 -7
  222. package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +8 -7
  223. package/src/commands/ClientToServer/ControlItemsRefreshCommand.d.ts +6 -6
  224. package/src/commands/ClientToServer/DataViewOutputCommand.d.ts +9 -9
  225. package/src/commands/ClientToServer/DataviewCommand.d.ts +32 -32
  226. package/src/commands/ClientToServer/EvaluateCommand.d.ts +16 -15
  227. package/src/commands/ClientToServer/EventCommand.d.ts +16 -15
  228. package/src/commands/ClientToServer/ExecOperCommand.d.ts +24 -23
  229. package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +9 -8
  230. package/src/commands/ClientToServer/GlobalParamsQueryCommand.d.ts +5 -5
  231. package/src/commands/ClientToServer/ICommandTaskTag.d.ts +3 -3
  232. package/src/commands/ClientToServer/IndexChangeEventCommand.d.ts +9 -8
  233. package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +11 -10
  234. package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +9 -8
  235. package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
  236. package/src/commands/ClientToServer/RecomputeCommand.d.ts +12 -11
  237. package/src/commands/ClientToServer/RefreshEventCommand.d.ts +13 -12
  238. package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +11 -10
  239. package/src/commands/ClientToServer/RollbackEventCommand.d.ts +15 -14
  240. package/src/commands/ClientToServer/SelectProgramCommand.d.ts +7 -6
  241. package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
  242. package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +9 -8
  243. package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +10 -9
  244. package/src/commands/ClientToServer/TransactionCommand.d.ts +14 -12
  245. package/src/commands/ClientToServer/UnloadCommand.d.ts +8 -7
  246. package/src/commands/ClientToServer/WriteMessageToServerLogCommand.d.ts +6 -6
  247. package/src/commands/DataViewCommandBase.d.ts +6 -6
  248. package/src/commands/IClientCommand.d.ts +2 -2
  249. package/src/commands/IClientTargetedCommand.d.ts +12 -12
  250. package/src/commands/IClientToServerCommandInfo.d.ts +4 -3
  251. package/src/commands/ServerToClient/AbortCommand.d.ts +11 -11
  252. package/src/commands/ServerToClient/AddLocateCommand.d.ts +6 -6
  253. package/src/commands/ServerToClient/AddRangeCommand.d.ts +10 -10
  254. package/src/commands/ServerToClient/AddSortCommand.d.ts +9 -9
  255. package/src/commands/ServerToClient/ClientRefreshCommand.d.ts +7 -7
  256. package/src/commands/ServerToClient/ClientTargetedCommandBase.d.ts +12 -12
  257. package/src/commands/ServerToClient/EnhancedVerifyCommand.d.ts +13 -13
  258. package/src/commands/ServerToClient/OpenURLCommand.d.ts +21 -21
  259. package/src/commands/ServerToClient/ResetLocateCommand.d.ts +6 -6
  260. package/src/commands/ServerToClient/ResetRangeCommand.d.ts +6 -6
  261. package/src/commands/ServerToClient/ResetSortCommand.d.ts +6 -6
  262. package/src/commands/ServerToClient/ResultCommand.d.ts +10 -10
  263. package/src/commands/ServerToClient/VerifyCommand.d.ts +17 -17
  264. package/src/commands/ServerToClient/XMLBasedCommandBuilder.d.ts +11 -11
  265. package/src/communications/IConnectionStateManager.d.ts +4 -4
  266. package/src/communications/InteractiveCommunicationsFailureHandler.d.ts +6 -6
  267. package/src/data/DataSourceIdKey.d.ts +2 -2
  268. package/src/data/DataView.d.ts +162 -162
  269. package/src/data/DataViewBase.d.ts +12 -12
  270. package/src/data/DataviewManager.d.ts +14 -14
  271. package/src/data/DataviewManagerBase.d.ts +11 -11
  272. package/src/data/DvCache.d.ts +15 -15
  273. package/src/data/Field.d.ts +103 -103
  274. package/src/data/FieldBase.d.ts +23 -23
  275. package/src/data/FieldsTable.d.ts +27 -27
  276. package/src/data/IRecordsTable.d.ts +7 -7
  277. package/src/data/Key.d.ts +15 -15
  278. package/src/data/Record.d.ts +157 -156
  279. package/src/data/RecordOutOfDataViewException.d.ts +10 -10
  280. package/src/data/RecordsTable.d.ts +38 -38
  281. package/src/data/TaskTransactionManager.d.ts +17 -17
  282. package/src/data/XMLBasedDcValuesBuilder.d.ts +11 -11
  283. package/src/enums.d.ts +21 -21
  284. package/src/env/EnvVariablesTable.d.ts +17 -17
  285. package/src/env/Environment.d.ts +118 -118
  286. package/src/env/ILanguageData.d.ts +3 -3
  287. package/src/env/LanguageData.d.ts +20 -20
  288. package/src/env/MirrorString.d.ts +15 -15
  289. package/src/event/ActionManager.d.ts +14 -14
  290. package/src/event/Event.d.ts +79 -79
  291. package/src/event/EventHandler.d.ts +66 -66
  292. package/src/event/EventHandlerPosition.d.ts +25 -25
  293. package/src/event/EventsManager.d.ts +205 -204
  294. package/src/event/IEventsManager.d.ts +77 -77
  295. package/src/event/RunTimeEvent.d.ts +126 -123
  296. package/src/event/RunTimeEventBase.d.ts +5 -5
  297. package/src/event/UserEventsTable.d.ts +11 -11
  298. package/src/exp/ExpTable.d.ts +11 -11
  299. package/src/exp/Expression.d.ts +37 -37
  300. package/src/exp/ExpressionDict.d.ts +12 -12
  301. package/src/exp/ExpressionEvaluator.d.ts +198 -198
  302. package/src/exp/ExpressionLocalJpn.d.ts +18 -18
  303. package/src/exp/GlobalParamsTable.d.ts +19 -19
  304. package/src/exp/YesNoExp.d.ts +9 -9
  305. package/src/gui/CreatedFormVector.d.ts +10 -10
  306. package/src/gui/FormsTable.d.ts +15 -15
  307. package/src/gui/MgControl.d.ts +60 -60
  308. package/src/gui/MgForm.d.ts +96 -93
  309. package/src/http/HttpManager.d.ts +25 -25
  310. package/src/http/client/HttpClientAsync.d.ts +16 -16
  311. package/src/http/client/HttpClientBase.d.ts +30 -30
  312. package/src/http/client/HttpClientEvents.d.ts +18 -18
  313. package/src/http/client/HttpClientSync.d.ts +17 -17
  314. package/src/http/client/HttpUtility.d.ts +10 -10
  315. package/src/http/client/ICommunicationsFailureHandler.d.ts +5 -5
  316. package/src/remote/AddUserLocateRemoteDataViewCommand.d.ts +8 -8
  317. package/src/remote/AddUserRangeRemoteDataViewCommand.d.ts +8 -8
  318. package/src/remote/AddUserSortRemoteDataViewCommand.d.ts +8 -8
  319. package/src/remote/RemoteCommandsProcessor.d.ts +51 -51
  320. package/src/remote/RemoteControlItemsRefreshCommand.d.ts +8 -8
  321. package/src/remote/RemoteDataViewCommandBase.d.ts +10 -10
  322. package/src/remote/RemoteDataViewCommandFactory.d.ts +6 -6
  323. package/src/remote/RemoteDataViewCommandUpdateNonModifiable.d.ts +8 -8
  324. package/src/remote/RemoteDataviewManager.d.ts +9 -9
  325. package/src/remote/RemoteInitDataViewCommand.d.ts +7 -7
  326. package/src/remote/ResetUserLocateRemoteDataviewCommand.d.ts +7 -7
  327. package/src/remote/ResetUserRangeRemoteDataviewCommand.d.ts +7 -7
  328. package/src/remote/ResetUserSortRemoteDataviewCommand.d.ts +7 -7
  329. package/src/remote/ServerError.d.ts +16 -16
  330. package/src/remote/SetTransactionStateRemoteDataViewCommand.d.ts +8 -8
  331. package/src/rt/Argument.d.ts +36 -36
  332. package/src/rt/ArgumentsList.d.ts +24 -24
  333. package/src/rt/Boundary.d.ts +27 -27
  334. package/src/rt/CompMainPrgTable.d.ts +10 -10
  335. package/src/rt/DataviewHeaderBase.d.ts +34 -34
  336. package/src/rt/DataviewHeaderFactory.d.ts +5 -5
  337. package/src/rt/DataviewHeaders.d.ts +12 -12
  338. package/src/rt/DataviewHeadersSaxHandler.d.ts +10 -10
  339. package/src/rt/ExecutionStack.d.ts +22 -22
  340. package/src/rt/ExecutionStackEntry.d.ts +7 -7
  341. package/src/rt/HandlersTable.d.ts +19 -19
  342. package/src/rt/IDataSourceViewDefinition.d.ts +6 -6
  343. package/src/rt/IDataviewHeader.d.ts +10 -10
  344. package/src/rt/IResultValue.d.ts +4 -4
  345. package/src/rt/LastFocusedManager.d.ts +23 -23
  346. package/src/rt/Operation.d.ts +97 -97
  347. package/src/rt/OperationTable.d.ts +15 -15
  348. package/src/rt/Recompute.d.ts +41 -41
  349. package/src/rt/RecomputeTable.d.ts +9 -9
  350. package/src/rt/RemoteDataviewHeader.d.ts +14 -14
  351. package/src/rt/ResultValue.d.ts +7 -7
  352. package/src/rt/TableCache.d.ts +29 -29
  353. package/src/rt/TableCacheManager.d.ts +10 -10
  354. package/src/rt/Transaction.d.ts +23 -23
  355. package/src/security/UserDetails.d.ts +16 -16
  356. package/src/tasks/IMGDataCollection.d.ts +26 -26
  357. package/src/tasks/MGData.d.ts +63 -63
  358. package/src/tasks/MGDataCollection.d.ts +42 -42
  359. package/src/tasks/RCTimer.d.ts +13 -13
  360. package/src/tasks/RemoteTaskService.d.ts +16 -16
  361. package/src/tasks/Task.d.ts +312 -312
  362. package/src/tasks/TaskBase.d.ts +123 -123
  363. package/src/tasks/TaskServiceBase.d.ts +16 -16
  364. package/src/tasks/TasksTable.d.ts +21 -21
  365. package/src/tasks/sort/Sort.d.ts +4 -4
  366. package/src/tasks/sort/SortCollection.d.ts +11 -11
  367. package/src/util/ConstUtils.d.ts +3 -3
  368. package/src/util/FlowMonitorQueue.d.ts +70 -70
  369. package/src/util/HeapSort.d.ts +6 -6
  370. package/src/util/IMirrorXML.d.ts +6 -6
  371. package/src/util/IServerConfig.d.ts +11 -11
  372. package/src/util/MgBlockingQueue.d.ts +5 -5
  373. package/src/util/MgPriorityBlockingQueue.d.ts +17 -17
  374. package/src/util/MgPriorityQueue.d.ts +13 -13
  375. package/src/util/ParamParseResult.d.ts +6 -6
  376. package/src/util/PrmMap.d.ts +28 -28
  377. package/src/util/ReturnResult.d.ts +18 -18
  378. package/src/util/ReturnResultBase.d.ts +11 -11
  379. package/src/util/Scrambler.d.ts +10 -10
  380. package/src/util/UniqueIDUtils.d.ts +4 -4
  381. package/src/util/cookie.service.d.ts +8 -8
  382. package/esm2020/src/AccessHelper.mjs +0 -9
  383. package/esm2020/src/ClientManager.mjs +0 -399
  384. package/esm2020/src/CommandsProcessorBase.mjs +0 -58
  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/ColumnSortEventCommand.mjs +0 -26
  396. package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
  397. package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
  398. package/esm2020/src/commands/ClientToServer/ComputeEventCommand.mjs +0 -23
  399. package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
  400. package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
  401. package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
  402. package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
  403. package/esm2020/src/commands/ClientToServer/IndexChangeEventCommand.mjs +0 -21
  404. package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
  405. package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
  406. package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
  407. package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
  408. package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
  409. package/esm2020/src/commands/ClientToServer/SelectProgramCommand.mjs +0 -15
  410. package/esm2020/src/commands/ClientToServer/SubformOpenEventCommand.mjs +0 -21
  411. package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
  412. package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
  413. package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
  414. package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
  415. package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
  416. package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
  417. package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
  418. package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
  419. package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
  420. package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
  421. package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
  422. package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
  423. package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
  424. package/esm2020/src/data/DataView.mjs +0 -1610
  425. package/esm2020/src/data/DataviewManager.mjs +0 -28
  426. package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
  427. package/esm2020/src/data/DvCache.mjs +0 -67
  428. package/esm2020/src/data/Field.mjs +0 -646
  429. package/esm2020/src/data/FieldBase.mjs +0 -18
  430. package/esm2020/src/data/FieldsTable.mjs +0 -103
  431. package/esm2020/src/data/Record.mjs +0 -846
  432. package/esm2020/src/data/RecordsTable.mjs +0 -267
  433. package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
  434. package/esm2020/src/env/Environment.mjs +0 -489
  435. package/esm2020/src/env/LanguageData.mjs +0 -226
  436. package/esm2020/src/event/ActionManager.mjs +0 -91
  437. package/esm2020/src/event/Event.mjs +0 -1333
  438. package/esm2020/src/event/EventHandler.mjs +0 -766
  439. package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
  440. package/esm2020/src/event/EventsManager.mjs +0 -2975
  441. package/esm2020/src/event/RunTimeEvent.mjs +0 -392
  442. package/esm2020/src/event/UserEventsTable.mjs +0 -47
  443. package/esm2020/src/exp/ExpTable.mjs +0 -59
  444. package/esm2020/src/exp/Expression.mjs +0 -200
  445. package/esm2020/src/exp/ExpressionDict.mjs +0 -727
  446. package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4208
  447. package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
  448. package/esm2020/src/exp/YesNoExp.mjs +0 -36
  449. package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
  450. package/esm2020/src/gui/FormsTable.mjs +0 -66
  451. package/esm2020/src/gui/MgControl.mjs +0 -353
  452. package/esm2020/src/gui/MgForm.mjs +0 -1181
  453. package/esm2020/src/http/HttpManager.mjs +0 -97
  454. package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
  455. package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
  456. package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
  457. package/esm2020/src/http/client/HttpUtility.mjs +0 -84
  458. package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
  459. package/esm2020/src/remote/ServerError.mjs +0 -40
  460. package/esm2020/src/rt/Argument.mjs +0 -265
  461. package/esm2020/src/rt/ArgumentsList.mjs +0 -103
  462. package/esm2020/src/rt/Boundary.mjs +0 -152
  463. package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
  464. package/esm2020/src/rt/DataviewHeaderBase.mjs +0 -96
  465. package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
  466. package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
  467. package/esm2020/src/rt/Operation.mjs +0 -735
  468. package/esm2020/src/rt/OperationTable.mjs +0 -67
  469. package/esm2020/src/rt/Recompute.mjs +0 -355
  470. package/esm2020/src/rt/ResultValue.mjs +0 -12
  471. package/esm2020/src/rt/TableCache.mjs +0 -177
  472. package/esm2020/src/rt/TableCacheManager.mjs +0 -67
  473. package/esm2020/src/rt/Transaction.mjs +0 -53
  474. package/esm2020/src/security/UserDetails.mjs +0 -71
  475. package/esm2020/src/tasks/MGData.mjs +0 -552
  476. package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
  477. package/esm2020/src/tasks/RCTimer.mjs +0 -63
  478. package/esm2020/src/tasks/Task.mjs +0 -2496
  479. package/esm2020/src/tasks/TaskBase.mjs +0 -87
  480. package/esm2020/src/tasks/TasksTable.mjs +0 -80
  481. package/esm2020/src/tasks/sort/Sort.mjs +0 -7
  482. package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
  483. package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
  484. package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
  485. package/esm2020/src/util/PrmMap.mjs +0 -151
  486. package/esm2020/src/util/ReturnResult.mjs +0 -46
  487. package/esm2020/src/util/ReturnResultBase.mjs +0 -18
  488. package/esm2020/src/util/Scrambler.mjs +0 -89
  489. package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
  490. package/fesm2015/magic-xpa-engine.mjs +0 -30837
  491. package/fesm2015/magic-xpa-engine.mjs.map +0 -1
  492. package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -0,0 +1,880 @@
1
+ import { DataModificationTypes, EMPTY_DCREF, ExpVal, ObjectReferenceBase, ObjectReferencesCollection, RecordUtils } from '@magic-xpa/gui';
2
+ import { ApplicationException, Int32, ISO_8859_1_Encoding, NNumber, NString, RefParam, StringBuilder, isNullOrUndefined } from '@magic-xpa/mscorelib';
3
+ import { Base64, Constants, Logger, StorageAttribute, StorageAttributeCheck, StrUtil, UtilStrByteMode, XMLConstants, XmlParser } from '@magic-xpa/utils';
4
+ import { ExpressionEvaluator, NullValueException } from '../exp/ExpressionEvaluator';
5
+ import { ConstInterface } from '../ConstInterface';
6
+ import { Environment } from '../env/Environment';
7
+ import { DataViewBase } from './DataViewBase';
8
+ import { RemoteCommandsProcessor } from "../remote/RemoteCommandsProcessor";
9
+ export class Record {
10
+ static FLAG_NULL = (0x01);
11
+ static FLAG_INVALID = (0x02);
12
+ static FLAG_MODIFIED = (0x04);
13
+ static FLAG_UPDATED = (0x08);
14
+ static FLAG_CRSR_MODIFIED = (0x10);
15
+ static FLAG_VALUE_NOT_PASSED = (0x20);
16
+ static FLAG_MODIFIED_ATLEAST_ONCE = (0x40);
17
+ _id = Int32.MinValue;
18
+ dbViewRowIdx = 0;
19
+ _mode = DataModificationTypes.None;
20
+ _dcRefs = null;
21
+ _inCompute = false;
22
+ _inRecompute = false;
23
+ _newRec = false;
24
+ get InCompute() {
25
+ return this._inCompute;
26
+ }
27
+ get InRecompute() {
28
+ return this._inRecompute;
29
+ }
30
+ static INCREASE = true;
31
+ static DECREASE = false;
32
+ _tableCache;
33
+ _inDeleteProcess;
34
+ _addAfter;
35
+ _causeInvalidation;
36
+ _dbPosBase64Val;
37
+ _dataview = null;
38
+ _fieldsData;
39
+ _flags;
40
+ _flagsHistory;
41
+ _forceSaveOrg;
42
+ _hashKey;
43
+ _computed;
44
+ _lateCompute;
45
+ _linksFldsPos;
46
+ _modified;
47
+ _next;
48
+ _prev;
49
+ _sendToServer = true;
50
+ _updated;
51
+ InForceUpdate;
52
+ Synced;
53
+ ValueInBase64;
54
+ constructor(dvOrTableCacheOrCIdOrRecord, dataview) {
55
+ if (dvOrTableCacheOrCIdOrRecord instanceof Record)
56
+ Object.assign(this, dvOrTableCacheOrCIdOrRecord);
57
+ else if (arguments.length === 1)
58
+ this.constructor_0(dvOrTableCacheOrCIdOrRecord);
59
+ else
60
+ this.constructor_1(dvOrTableCacheOrCIdOrRecord, dataview);
61
+ }
62
+ constructor_0(dvOrTableCache) {
63
+ if (dvOrTableCache instanceof DataViewBase)
64
+ this._dataview = dvOrTableCache;
65
+ else
66
+ this._tableCache = dvOrTableCache;
67
+ this._fieldsData = new Array(this.getFieldsTab().getSize());
68
+ this._flags = new Uint8Array(this.getFieldsTab().getSize());
69
+ this._flagsHistory = new Uint8Array(this.getFieldsTab().getSize());
70
+ this._dcRefs = new ObjectReferencesCollection();
71
+ }
72
+ Initialize() {
73
+ for (let i = 0; i < this._flags.length; i = i + 1) {
74
+ let field = this.getFieldsTab().getField(i);
75
+ this._flags[i] = ((field.isNullDefault() || field.getType() === StorageAttribute.BLOB_VECTOR) ? Record.FLAG_NULL : 0);
76
+ if (this._dataview !== null && field.IsVirtual) {
77
+ let record = this._dataview.getCurrRec();
78
+ if (record != null && record.IsFldModifiedAtLeastOnce(i)) {
79
+ this.setFlag(i, Record.FLAG_MODIFIED_ATLEAST_ONCE);
80
+ }
81
+ }
82
+ this._flagsHistory[i] = this._flags[i];
83
+ }
84
+ this.setNewRec();
85
+ }
86
+ constructor_1(cId, dataview) {
87
+ this.constructor_0(dataview);
88
+ this.setId(cId);
89
+ }
90
+ get Modified() {
91
+ return this._modified;
92
+ }
93
+ get Updated() {
94
+ return this._updated;
95
+ }
96
+ get SendToServer() {
97
+ return this._sendToServer;
98
+ }
99
+ CompareTo(obj) {
100
+ let res = 0;
101
+ let compTo = obj;
102
+ let key = this._tableCache.GetKeyById(this._tableCache.GetCurrSortKey());
103
+ if (key != null) {
104
+ for (let i = 0; i < key.Columns.length; i++) {
105
+ let currFld = key.Columns.get_Item(i);
106
+ let currFldId = currFld.getId();
107
+ if (this.IsNull(currFldId) && compTo.IsNull(currFldId))
108
+ continue;
109
+ else if (this.IsNull(currFldId) && !compTo.IsNull(currFldId)) {
110
+ res = 1;
111
+ break;
112
+ }
113
+ else if (!this.IsNull(currFldId) && compTo.IsNull(currFldId)) {
114
+ res = -1;
115
+ break;
116
+ }
117
+ else {
118
+ try {
119
+ let first = new ExpVal(currFld.getType(), false, this.GetFieldValue(currFldId));
120
+ let second = new ExpVal(currFld.getType(), false, compTo.GetFieldValue(currFldId));
121
+ res = ExpressionEvaluator.val_cmp_any(first, second);
122
+ if (res !== 0)
123
+ break;
124
+ }
125
+ catch (err) {
126
+ if (err instanceof NullValueException)
127
+ Logger.Instance.WriteExceptionToLogWithMsg(" in Record.CompareTo null value was reached");
128
+ }
129
+ }
130
+ }
131
+ return res;
132
+ }
133
+ else {
134
+ res = -1;
135
+ return res;
136
+ }
137
+ }
138
+ getMode() {
139
+ return this._mode;
140
+ }
141
+ getId() {
142
+ return this._id;
143
+ }
144
+ isNewRec() {
145
+ return this._newRec;
146
+ }
147
+ getFieldDataXML(fldIdx, getOldVal) {
148
+ let fldVal;
149
+ if (!getOldVal)
150
+ fldVal = this.GetFieldValue(fldIdx);
151
+ else
152
+ fldVal = (this.getFieldsTab().getField(fldIdx)).getOriginalValue();
153
+ if (fldVal == null)
154
+ throw new ApplicationException("in Record.buildFieldsData() null field value!\nField id: " + fldIdx);
155
+ let tmpBuf = this.getXMLForValue(fldIdx, fldVal);
156
+ return XmlParser.escape(tmpBuf.toString()).toString();
157
+ }
158
+ getFieldsTab() {
159
+ if (this._dataview !== null)
160
+ return this._dataview.GetFieldsTab();
161
+ else
162
+ return this._tableCache.FldsTab;
163
+ }
164
+ setInitialFldVals(clobberedOnly, isNewRec) {
165
+ let i, size;
166
+ let fld = null;
167
+ size = this.getSizeFld(true);
168
+ for (i = 0; i < size; i++) {
169
+ if (this._fieldsData[i] === null || typeof this._fieldsData[i] === "undefined") {
170
+ fld = this.getFieldsTab().getField(i);
171
+ this._fieldsData[i] = fld.getNewRecValue(clobberedOnly);
172
+ if (isNewRec && fld.IsVirtual && !fld.isNull())
173
+ this.clearFlag(fld.getId(), Record.FLAG_NULL);
174
+ if (fld.IsVirtual && fld.getModifiedAtLeastOnce())
175
+ this.setFlag(fld.getId(), Record.FLAG_MODIFIED_ATLEAST_ONCE);
176
+ if (this._fieldsData[i] === null || typeof this._fieldsData[i] === "undefined")
177
+ this._fieldsData[i] = fld.getDefaultValue();
178
+ }
179
+ }
180
+ }
181
+ setId(cId) {
182
+ this._id = cId;
183
+ this._hashKey = this._id;
184
+ }
185
+ setDBViewRowIdx(rowId) {
186
+ this.dbViewRowIdx = rowId;
187
+ }
188
+ getDBViewRowIdx() {
189
+ return this.dbViewRowIdx;
190
+ }
191
+ fillData(parser) {
192
+ let isCurrRec = false;
193
+ let endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_TERM, parser.getCurrIndex());
194
+ if (endContext !== -1 && endContext < parser.getXMLdata().length) {
195
+ let tag = parser.getXMLsubstring(endContext);
196
+ parser.add2CurrIndex(tag.indexOf(ConstInterface.MG_TAG_REC) + ConstInterface.MG_TAG_REC.length);
197
+ let tokensVector = XmlParser.getTokens(parser.getXMLsubstring(endContext), XMLConstants.XML_ATTR_DELIM);
198
+ isCurrRec = this.initElements(tokensVector);
199
+ parser.setCurrIndex(endContext + XMLConstants.TAG_TERM.length);
200
+ }
201
+ else
202
+ Logger.Instance.WriteExceptionToLogWithMsg("in Record.FillInnerData() out of bounds");
203
+ return isCurrRec;
204
+ }
205
+ initElements(tokensVector) {
206
+ let attribute, valueStr;
207
+ let recFieldsData = null;
208
+ let recFlags = null;
209
+ let j = 0;
210
+ let isCurrRec;
211
+ isCurrRec = this.peekIsCurrRec(tokensVector);
212
+ for (; j < tokensVector.length; j += 2) {
213
+ attribute = (tokensVector.get_Item(j));
214
+ valueStr = (tokensVector.get_Item(j + 1));
215
+ switch (attribute) {
216
+ case ConstInterface.MG_ATTR_MODE:
217
+ this._mode = valueStr[0];
218
+ break;
219
+ case XMLConstants.MG_ATTR_ID:
220
+ this.setId(XmlParser.getInt(valueStr));
221
+ break;
222
+ case XMLConstants.MG_ATTR_VB_VIEW_ROWIDX:
223
+ this.setDBViewRowIdx(XmlParser.getInt(valueStr));
224
+ break;
225
+ case XMLConstants.MG_ATTR_VALUE:
226
+ if (this.ValueInBase64) {
227
+ recFieldsData = Base64.decode(valueStr);
228
+ }
229
+ else {
230
+ recFieldsData = XmlParser.unescape(valueStr);
231
+ }
232
+ break;
233
+ case ConstInterface.MG_ATTR_CURR_REC:
234
+ {
235
+ }
236
+ break;
237
+ case ConstInterface.MG_ATTR_ADD_AFTER:
238
+ this._addAfter = XmlParser.getInt(valueStr);
239
+ break;
240
+ case ConstInterface.MG_ATTR_FLAGS:
241
+ recFlags = valueStr;
242
+ break;
243
+ case ConstInterface.MG_ATTR_MODIFIED:
244
+ this._modified = true;
245
+ break;
246
+ case ConstInterface.MG_ATTR_DC_REFS:
247
+ this.fillDCRef(valueStr);
248
+ break;
249
+ case ConstInterface.MG_ATTR_DBPOS:
250
+ this._dbPosBase64Val = valueStr;
251
+ break;
252
+ default:
253
+ Logger.Instance.WriteExceptionToLogWithMsg("in Record.initElements() unknown attribute: " + attribute);
254
+ break;
255
+ }
256
+ }
257
+ if (this.ValueInBase64) {
258
+ let fldValInBytes = ISO_8859_1_Encoding.ISO_8859_1.GetBytes(recFieldsData);
259
+ this.fillFieldsData(fldValInBytes, recFlags);
260
+ }
261
+ else {
262
+ this.fillFieldsData(recFieldsData, recFlags, isCurrRec);
263
+ }
264
+ return isCurrRec;
265
+ }
266
+ peekIsCurrRec(tokensVector) {
267
+ let attribute;
268
+ let valueStr;
269
+ for (let j = 0; j < tokensVector.length; j += 2) {
270
+ attribute = (tokensVector.get_Item(j));
271
+ if (attribute === ConstInterface.MG_ATTR_CURR_REC) {
272
+ valueStr = (tokensVector.get_Item(j + 1));
273
+ return XmlParser.getBoolean(valueStr);
274
+ }
275
+ }
276
+ return false;
277
+ }
278
+ fillFieldsData(fldValInBytesOrFldsVal, recFlags, isCurrRec) {
279
+ if (isNullOrUndefined(isCurrRec))
280
+ this.fillFieldsData_0();
281
+ else
282
+ this.fillFieldsData_1(fldValInBytesOrFldsVal, recFlags, isCurrRec);
283
+ }
284
+ fillFieldsData_0() {
285
+ }
286
+ fillFieldsData_1(fldsVal, recFlags, isCurrRec) {
287
+ let val = null;
288
+ let tmp = null;
289
+ let parsedLen = new RefParam(0);
290
+ let i, j = 0, from, size;
291
+ let currType;
292
+ let useHex;
293
+ let fld = null;
294
+ let valueNotPassed;
295
+ from = this.getFromFldIdx(isCurrRec);
296
+ size = this.getSizeFld(isCurrRec);
297
+ for (i = from; j < size; i++, j++) {
298
+ fld = this.getFieldsTab().getField(i);
299
+ currType = fld.getType();
300
+ useHex = (Environment.Instance.GetDebugLevel() > 1 ||
301
+ currType === StorageAttribute.ALPHA ||
302
+ currType === StorageAttribute.UNICODE ||
303
+ StorageAttributeCheck.isTypeLogical(currType));
304
+ if (recFlags[j] === '.')
305
+ this._flags[i] = 0;
306
+ else if (recFlags[j] === '/')
307
+ this._flags[i] = 1;
308
+ else {
309
+ tmp = recFlags.substr(j * 2, 2);
310
+ this._flags[i] = parseInt(tmp, 16);
311
+ }
312
+ valueNotPassed = Record.FLAG_VALUE_NOT_PASSED === (this._flags[i] & Record.FLAG_VALUE_NOT_PASSED);
313
+ this._flags[i] = this._flags[i] & ~Record.FLAG_VALUE_NOT_PASSED;
314
+ this._flagsHistory[i] = this._flags[i];
315
+ if (Record.FLAG_UPDATED === (this._flags[i] & Record.FLAG_UPDATED))
316
+ this._updated = true;
317
+ if (valueNotPassed) {
318
+ if (Record.FLAG_NULL === (this._flags[i] & Record.FLAG_NULL)) {
319
+ val = fld.getDefaultValue();
320
+ }
321
+ else {
322
+ val = this._dataview.getCurrRec().GetFieldValue(i);
323
+ }
324
+ }
325
+ else {
326
+ val = RecordUtils.deSerializeItemVal(fldsVal, currType, fld.getSize(), useHex, fld.getCellsType(), parsedLen);
327
+ fldsVal = fldsVal.substr(parsedLen.value);
328
+ }
329
+ this._fieldsData[i] = val;
330
+ }
331
+ this.setInitialFldVals(false, false);
332
+ }
333
+ fillDCRef(valueStr) {
334
+ if (!NString.IsNullOrEmpty(valueStr)) {
335
+ let couples = StrUtil.tokenize(valueStr, "$");
336
+ let size = couples.length;
337
+ for (let i = 0; i < size; i = i + 1) {
338
+ this._dcRefs.Add(DcValuesReference.Parse(couples[i], this._dataview));
339
+ }
340
+ }
341
+ }
342
+ buildFieldsData(message, isCurrRec, getOldVal) {
343
+ let tmpStr = new StringBuilder();
344
+ let from = this.getFromFldIdx(isCurrRec);
345
+ let size = this.getSizeFld(isCurrRec);
346
+ for (let i = from; i < from + size; i = i + 1) {
347
+ let fld = this.getFieldsTab().getField(i);
348
+ if (fld.IsExposedToClient === false)
349
+ this.setShrinkFlag(i);
350
+ if (Record.FLAG_VALUE_NOT_PASSED === (this._flags[i] & Record.FLAG_VALUE_NOT_PASSED))
351
+ continue;
352
+ tmpStr.Append(this.getFieldDataXML(i, getOldVal).toString());
353
+ }
354
+ if (tmpStr.Length === 0) {
355
+ tmpStr.Append(" ");
356
+ }
357
+ message.Append(tmpStr.ToString());
358
+ }
359
+ getXMLForValue(fldIdx, fldVal) {
360
+ let cellAttr = StorageAttribute.SKIP;
361
+ let fldAttr = this.getFieldsTab().getType(fldIdx);
362
+ if (fldAttr === StorageAttribute.BLOB_VECTOR)
363
+ cellAttr = this.getFieldsTab().getField(fldIdx).getCellsType();
364
+ let toBase64 = Environment.Instance.GetDebugLevel() <= 1;
365
+ return Record.serializeItemVal(fldVal, fldAttr, cellAttr, toBase64);
366
+ }
367
+ getFromFldIdx(isCurrRec) {
368
+ if (isCurrRec)
369
+ return 0;
370
+ else
371
+ return this.getFieldsTab().getRMIdx();
372
+ }
373
+ getSizeFld(isCurrRec) {
374
+ if (isCurrRec)
375
+ return this.getFieldsTab().getSize();
376
+ else
377
+ return this.getFieldsTab().getRMSize();
378
+ }
379
+ buildXML(message, isCurrRec, forceBuild) {
380
+ if (isNullOrUndefined(forceBuild))
381
+ this.buildXML_0(message, isCurrRec);
382
+ else
383
+ this.buildXML_1(message, isCurrRec, forceBuild);
384
+ }
385
+ buildXML_0(message, isCurrRec) {
386
+ this.buildXML_1(message, isCurrRec, false);
387
+ }
388
+ buildXML_1(message, isCurrRec, forceBuild) {
389
+ let recFlags;
390
+ let from, size, i;
391
+ let aFlag;
392
+ let hexFlag;
393
+ if (!forceBuild)
394
+ if (this._mode !== DataModificationTypes.Insert && this._mode !== DataModificationTypes.Update &&
395
+ this._mode !== DataModificationTypes.Delete && !isCurrRec)
396
+ return;
397
+ message.Append("\n <" + ConstInterface.MG_TAG_REC);
398
+ if (this._id > Int32.MinValue)
399
+ message.Append(" " + XMLConstants.MG_ATTR_ID + "=\"" + this._id + "\"");
400
+ message.Append(" " + ConstInterface.MG_ATTR_MODE + "=\"" + this._mode + "\"");
401
+ if (this._mode === DataModificationTypes.Insert && this._prev != null)
402
+ message.Append(" " + ConstInterface.MG_ATTR_ADD_AFTER + "=\"" + this._prev.getId() + "\"");
403
+ if (!forceBuild && !isCurrRec)
404
+ this.clearMode();
405
+ message.Append(" " + XMLConstants.MG_ATTR_VALUE + "=\"");
406
+ if (!forceBuild && isCurrRec)
407
+ this.setShrinkFlags();
408
+ let getOldVal;
409
+ if (this.Synced)
410
+ getOldVal = false;
411
+ else {
412
+ let task = this._dataview.getTask();
413
+ getOldVal = (!isCurrRec && (task.getLevel() === Constants.TASK_LEVEL_RECORD ||
414
+ task.getLevel() === Constants.TASK_LEVEL_CONTROL) &&
415
+ this._dataview.getCurrRec() != null && this._dataview.getCurrRec().getId() === this._id);
416
+ }
417
+ this.buildFieldsData(message, isCurrRec, getOldVal);
418
+ message.Append("\"");
419
+ recFlags = new StringBuilder();
420
+ from = this.getFromFldIdx(isCurrRec);
421
+ size = this.getSizeFld(isCurrRec);
422
+ for (i = from; i < from + size; i++) {
423
+ aFlag = this._flagsHistory[i];
424
+ aFlag = aFlag & Record.FLAG_CRSR_MODIFIED;
425
+ aFlag = aFlag | this._flags[i];
426
+ hexFlag = NNumber.ToString(aFlag, "X2");
427
+ recFlags.Append(hexFlag);
428
+ if (isCurrRec)
429
+ this._flags[i] = (this._flags[i] & ~Record.FLAG_VALUE_NOT_PASSED);
430
+ }
431
+ message.Append(" " + ConstInterface.MG_ATTR_FLAGS + "=\"" + recFlags.ToString() + "\"");
432
+ if (isCurrRec) {
433
+ message.Append(" " + ConstInterface.MG_ATTR_CURR_REC + "=\"1\"");
434
+ if (this.Modified)
435
+ message.Append(" " + ConstInterface.MG_ATTR_MODIFIED + "=\"1\"");
436
+ }
437
+ if (this._linksFldsPos != null)
438
+ message.Append(" " + ConstInterface.MG_ATTR_DBPOS + "=\"" + XmlParser.escape(this._linksFldsPos) + "\" ");
439
+ message.Append(XMLConstants.TAG_TERM);
440
+ }
441
+ setShrinkFlags() {
442
+ let i;
443
+ let size = this.getSizeFld(true);
444
+ let serverCurrRec = this._dataview.getServerCurrRec();
445
+ if (serverCurrRec == null)
446
+ return;
447
+ for (i = 0; i < size; i++) {
448
+ if (this.fldValsEqual(serverCurrRec, i) || (Record.FLAG_NULL === (this._flags[i] & Record.FLAG_NULL))) {
449
+ this._flags[i] = this._flags[i] | Record.FLAG_VALUE_NOT_PASSED;
450
+ }
451
+ }
452
+ }
453
+ setShrinkFlag(fldIdx) {
454
+ this._flags[fldIdx] |= Record.FLAG_VALUE_NOT_PASSED;
455
+ }
456
+ SetFieldValue(idx, isNull, value) {
457
+ let field = this.getFieldsTab().getField(idx);
458
+ field.UpdateNull(isNull, this);
459
+ value = this.CheckMgValue(value, isNull, field);
460
+ this._fieldsData[idx] = value;
461
+ field.takeValFromRec();
462
+ this.clearFlag(field.getId(), Record.FLAG_INVALID);
463
+ field.invalidate(true, false);
464
+ }
465
+ setFieldValue(fldIdx, mgVal, setRecordUpdated) {
466
+ let fld = this.getFieldsTab().getField(fldIdx);
467
+ if (fld.PrevIsNull() === fld.isNull() && mgVal === this.GetFieldValue(fldIdx))
468
+ return;
469
+ mgVal = this.CheckMgValue(mgVal, fld.isNull(), fld);
470
+ if (fldIdx >= 0 && fldIdx < this.getFieldsTab().getSize()) {
471
+ this._fieldsData[fldIdx] = mgVal;
472
+ if (setRecordUpdated) {
473
+ if (fld.PartOfDataview)
474
+ this._modified = true;
475
+ if (RemoteCommandsProcessor.GetInstance().DelayCommandExecution) {
476
+ RemoteCommandsProcessor.GetInstance().DelayCommandExecution = false;
477
+ this._dataview.getTask().DelayCommandExecution = true;
478
+ }
479
+ this._dataview.setChanged(true);
480
+ this.setMode(DataModificationTypes.Update);
481
+ }
482
+ }
483
+ else
484
+ Logger.Instance.WriteExceptionToLogWithMsg("in Record.setFieldValue() illegal field index: " + fldIdx);
485
+ }
486
+ CheckMgValue(mgVal, isNull, fld) {
487
+ if (mgVal === null || isNull) {
488
+ mgVal = fld.getNullValue();
489
+ if (mgVal === null)
490
+ mgVal = fld.getMagicDefaultValue();
491
+ }
492
+ let size = fld.getSize();
493
+ if (UtilStrByteMode.isLocaleDefLangDBCS() && fld.getType() !== StorageAttribute.UNICODE) {
494
+ if (mgVal !== null && UtilStrByteMode.lenB(mgVal) > size)
495
+ mgVal = UtilStrByteMode.leftB(mgVal, size);
496
+ }
497
+ else {
498
+ if (mgVal !== null && mgVal.length > size)
499
+ mgVal = mgVal.substr(0, size);
500
+ }
501
+ return mgVal;
502
+ }
503
+ setModified() {
504
+ this._modified = true;
505
+ }
506
+ resetModified() {
507
+ this._modified = false;
508
+ }
509
+ setUpdated() {
510
+ this._updated = true;
511
+ }
512
+ resetUpdated() {
513
+ this._updated = false;
514
+ }
515
+ GetFieldValue(fldIdx) {
516
+ let val = null;
517
+ if (fldIdx >= 0 && fldIdx < this._fieldsData.length)
518
+ val = this._fieldsData[fldIdx];
519
+ return val.toString();
520
+ }
521
+ replicate() {
522
+ let record = new Record(this);
523
+ record._fieldsData = this._fieldsData.slice();
524
+ record._flags = this._flags.subarray(0);
525
+ record._flagsHistory = this._flagsHistory.subarray(0);
526
+ record._dcRefs = this._dcRefs.Clone();
527
+ return record;
528
+ }
529
+ setSameAs(rec, realOnly, rId) {
530
+ if (arguments.length === 3)
531
+ this.setSameAs_0(rec, realOnly, rId);
532
+ else
533
+ this.setSameAs_1(rec, realOnly);
534
+ }
535
+ setSameAs_0(rec, realOnly, rId) {
536
+ this.setSameAs(rec, realOnly);
537
+ this.setId(rId);
538
+ }
539
+ setSameAs_1(rec, realOnly) {
540
+ this._id = rec._id;
541
+ this._hashKey = rec._hashKey;
542
+ if (!this._dataview.getTask().transactionFailed(ConstInterface.TRANS_RECORD_PREFIX))
543
+ this.setMode(rec._mode);
544
+ this._addAfter = rec._addAfter;
545
+ if (realOnly) {
546
+ for (let i = 0; i < this.getFieldsTab().getSize(); i = i + 1) {
547
+ let afield = rec.getFieldsTab().getField(i);
548
+ if (!afield.IsVirtual) {
549
+ this._fieldsData[i] = rec._fieldsData[i];
550
+ this._flags[i] = rec._flags[i];
551
+ this._flagsHistory[i] = rec._flagsHistory[i];
552
+ }
553
+ }
554
+ }
555
+ else {
556
+ this._fieldsData = rec._fieldsData;
557
+ this._flags = rec._flags;
558
+ this._flagsHistory = rec._flagsHistory;
559
+ }
560
+ this._modified = rec._modified;
561
+ this._dataview = rec._dataview;
562
+ this._computed = rec._computed;
563
+ this._updated = rec._updated;
564
+ this.setDcRefs(rec._dcRefs);
565
+ if (rec._next !== this) {
566
+ this._next = rec._next;
567
+ }
568
+ if (rec._prev !== this) {
569
+ this._prev = rec._prev;
570
+ }
571
+ }
572
+ IsNull(fldIdx) {
573
+ this.checkFlags(fldIdx);
574
+ return ((this._flags[fldIdx] & Record.FLAG_NULL) === Record.FLAG_NULL);
575
+ }
576
+ isLinkInvalid(fldIdx) {
577
+ this.checkFlags(fldIdx);
578
+ return ((this._flags[fldIdx] & Record.FLAG_INVALID) === Record.FLAG_INVALID);
579
+ }
580
+ isFldModified(fldIdx) {
581
+ this.checkFlags(fldIdx);
582
+ return ((this._flags[fldIdx] & Record.FLAG_MODIFIED) === Record.FLAG_MODIFIED);
583
+ }
584
+ IsFldModifiedAtLeastOnce(fldIdx) {
585
+ this.checkFlags(fldIdx);
586
+ return ((this._flags[fldIdx] & Record.FLAG_MODIFIED_ATLEAST_ONCE) === Record.FLAG_MODIFIED_ATLEAST_ONCE);
587
+ }
588
+ isFldUpdated(fldIdx) {
589
+ this.checkFlags(fldIdx);
590
+ return ((this._flags[fldIdx] & Record.FLAG_UPDATED) === Record.FLAG_UPDATED);
591
+ }
592
+ setFlag(fldIdx, aFlag) {
593
+ this.checkFlags(fldIdx);
594
+ this._flags[fldIdx] = this._flags[fldIdx] | aFlag;
595
+ if (aFlag === Record.FLAG_CRSR_MODIFIED)
596
+ this._flagsHistory[fldIdx] = this._flagsHistory[fldIdx] | aFlag;
597
+ }
598
+ clearFlag(fldIdx, aFlags) {
599
+ this.checkFlags(fldIdx);
600
+ this._flags[fldIdx] = this._flags[fldIdx] & ~aFlags;
601
+ }
602
+ clearFlagsHistory() {
603
+ for (let i = 0; i < this._flags.length; i = i + 1)
604
+ this._flagsHistory[i] = 0;
605
+ }
606
+ clearFlags(aFlags) {
607
+ for (let i = 0; i < this._flags.length; i = i + 1)
608
+ this.clearFlag(i, aFlags);
609
+ }
610
+ clearFlagsForRealOnly(aFlags) {
611
+ for (let i = 0; i < this._flags.length; i = i + 1) {
612
+ let field = this.getFieldsTab().getField(i);
613
+ if (!field.IsVirtual) {
614
+ this.clearFlag(i, aFlags);
615
+ }
616
+ }
617
+ }
618
+ clearHistoryFlag(fldIdx) {
619
+ if (this._flagsHistory !== null && fldIdx < this.getFieldsTab().getSize() && fldIdx >= 0) {
620
+ this._flagsHistory[fldIdx] = 0;
621
+ }
622
+ }
623
+ checkFlags(fldIdx) {
624
+ if (this._flags === null || fldIdx >= this.getFieldsTab().getSize() || fldIdx < 0) {
625
+ throw new ApplicationException("Cannot find flags");
626
+ }
627
+ }
628
+ restart(oldMode) {
629
+ let task = this._dataview.getTask();
630
+ if (oldMode === DataModificationTypes.None) {
631
+ let rec = this._dataview.getCurrRec();
632
+ let isCurrRec = (rec != null && rec.getId() === this._id);
633
+ if ((this._dataview.getTask()).getMode() === Constants.TASK_MODE_CREATE)
634
+ if (isCurrRec && !task.getAfterRetry() && task.TryingToCommit && !this._dataview.inRollback())
635
+ oldMode = DataModificationTypes.Update;
636
+ else
637
+ oldMode = DataModificationTypes.Insert;
638
+ else
639
+ oldMode = DataModificationTypes.Update;
640
+ }
641
+ this.setMode(oldMode);
642
+ if (oldMode === DataModificationTypes.Insert)
643
+ this.setNewRec();
644
+ }
645
+ setLateCompute(val) {
646
+ this._lateCompute = val;
647
+ }
648
+ lateCompute() {
649
+ return this._lateCompute;
650
+ }
651
+ setInDeleteProcess(val) {
652
+ this._inDeleteProcess = val;
653
+ }
654
+ inDeleteProcess() {
655
+ return this._inDeleteProcess;
656
+ }
657
+ removeRecFromDc() {
658
+ if (this._dcRefs !== null) {
659
+ this._dcRefs.Dispose();
660
+ }
661
+ }
662
+ isSameRecData(rec, currRec, checkOnlyParetOfDataview) {
663
+ let size = this.getSizeFld(currRec);
664
+ let start = this.getFromFldIdx(currRec);
665
+ let i;
666
+ let field;
667
+ if (this === rec)
668
+ return true;
669
+ try {
670
+ if (rec.getSizeFld(currRec) !== size)
671
+ return false;
672
+ if (rec.getFromFldIdx(currRec) !== start)
673
+ return false;
674
+ for (i = 0; i < start + size; i++) {
675
+ field = this.getFieldsTab().getField(i);
676
+ if (checkOnlyParetOfDataview && !field.PartOfDataview)
677
+ continue;
678
+ if (!this.fldValsEqual(rec, i))
679
+ return false;
680
+ }
681
+ }
682
+ catch (err) {
683
+ if (err instanceof ApplicationException)
684
+ return false;
685
+ throw err;
686
+ }
687
+ return true;
688
+ }
689
+ getUpdatedFields() {
690
+ let dv = this._dataview;
691
+ let originalRec = dv.getOriginalRec();
692
+ let size = this.getSizeFld(false);
693
+ let start = this.getFromFldIdx(false);
694
+ let fields = [];
695
+ for (let i = 0; i < start + size; i++) {
696
+ const field = this.getFieldsTab().getField(i);
697
+ if (field.PartOfDataview && !this.fldValsEqual(originalRec, i))
698
+ fields.push(' ' + field.getTableName() + '.' + field.getVarName());
699
+ }
700
+ if (fields.length > 0)
701
+ return fields.toString().trim();
702
+ }
703
+ fldValsEqual(rec, fldIdx) {
704
+ let type = this.getFieldsTab().getField(fldIdx).getType();
705
+ return ExpressionEvaluator.mgValsEqual(this.GetFieldValue(fldIdx), this.IsNull(fldIdx), type, rec.GetFieldValue(fldIdx), rec.IsNull(fldIdx), type);
706
+ }
707
+ getHashKey() {
708
+ return this._hashKey;
709
+ }
710
+ setNextRec(nextRec) {
711
+ this._next = nextRec;
712
+ }
713
+ setPrevRec(prevRec) {
714
+ this._prev = prevRec;
715
+ }
716
+ getPrevRec() {
717
+ return this._prev;
718
+ }
719
+ getNextRec() {
720
+ return this._next;
721
+ }
722
+ getDcRefs() {
723
+ return this._dcRefs.Clone();
724
+ }
725
+ setDcRefs(newDcRefs) {
726
+ this.removeRecFromDc();
727
+ this._dcRefs = newDcRefs.Clone();
728
+ this.SetDcValueId();
729
+ }
730
+ realModified() {
731
+ let bRc = false;
732
+ let tabSize = this.getFieldsTab().getSize();
733
+ let j;
734
+ for (j = 0; j < tabSize; j++) {
735
+ if ((this._flags[j] & Record.FLAG_MODIFIED) === Record.FLAG_MODIFIED) {
736
+ if (!(this.getFieldsTab().getField(j).IsVirtual)) {
737
+ bRc = true;
738
+ break;
739
+ }
740
+ }
741
+ }
742
+ return bRc;
743
+ }
744
+ ToString() {
745
+ let str = new StringBuilder();
746
+ this.buildXML(str, (this._dataview.getCurrRec()).getId() === this._id, true);
747
+ return str.ToString();
748
+ }
749
+ setSendToServer(val) {
750
+ this._sendToServer = val;
751
+ }
752
+ getRecSize() {
753
+ let sum = 0;
754
+ for (let i = 0; i < this.getFieldsTab().getSize(); i = i + 1) {
755
+ let field = this.getFieldsTab().getField(i);
756
+ sum = sum + field.getSize();
757
+ }
758
+ return sum;
759
+ }
760
+ copyCrsrModifiedFlags(rec) {
761
+ let tabSize = this.getFieldsTab().getSize();
762
+ let j;
763
+ for (j = 0; j < tabSize; j++) {
764
+ this._flags[j] = rec._flags[j];
765
+ this._flags[j] = this._flags[j] & Record.FLAG_CRSR_MODIFIED;
766
+ }
767
+ }
768
+ getDbPosVal() {
769
+ return this._dbPosBase64Val;
770
+ }
771
+ buildLinksPosStr() {
772
+ let tbl = this._dataview.getTask().getDataviewHeaders();
773
+ if (tbl !== null) {
774
+ this._linksFldsPos = tbl.buildDbPosString();
775
+ }
776
+ }
777
+ setForceSaveOrg(val) {
778
+ this._forceSaveOrg = val;
779
+ }
780
+ getForceSaveOrg() {
781
+ return this._forceSaveOrg;
782
+ }
783
+ isCauseInvalidation() {
784
+ return this._causeInvalidation;
785
+ }
786
+ setCauseInvalidation(causeInvalidation) {
787
+ this._causeInvalidation = causeInvalidation;
788
+ }
789
+ isComputed() {
790
+ return this._computed;
791
+ }
792
+ setComputed(val) {
793
+ this._computed = val;
794
+ }
795
+ setInCompute(val) {
796
+ if (!val)
797
+ this.setComputed(true);
798
+ this._inCompute = val;
799
+ }
800
+ setInRecompute(val) {
801
+ this._inRecompute = val;
802
+ }
803
+ setMode(newMode) {
804
+ switch (newMode) {
805
+ case DataModificationTypes.None:
806
+ case DataModificationTypes.Insert:
807
+ case DataModificationTypes.Update:
808
+ case DataModificationTypes.Delete:
809
+ if (this._mode === DataModificationTypes.None ||
810
+ this._mode === DataModificationTypes.Update && newMode === DataModificationTypes.Delete)
811
+ this._mode = newMode;
812
+ break;
813
+ default:
814
+ Logger.Instance.WriteExceptionToLogWithMsg("in Record.setMode(): illegal mode: " + newMode);
815
+ break;
816
+ }
817
+ }
818
+ clearMode() {
819
+ this._mode = DataModificationTypes.None;
820
+ }
821
+ setOldRec() {
822
+ this._newRec = false;
823
+ }
824
+ setNewRec() {
825
+ this._newRec = true;
826
+ }
827
+ static serializeItemVal(itemVal, itemAttr, cellAttr, ToBase64) {
828
+ return RecordUtils.serializeItemVal(itemVal, itemAttr, cellAttr, ToBase64);
829
+ }
830
+ SetDcValueId() {
831
+ let form = this._dataview.getTask().getForm();
832
+ let mgControl = null;
833
+ if (form != null && this._dcRefs != null) {
834
+ this._dcRefs.Refs.forEach((dcRef) => {
835
+ mgControl = form.getCtrl(dcRef.ditIdx);
836
+ if (mgControl != null)
837
+ mgControl.setDcValId(dcRef.DcValues.getId());
838
+ });
839
+ }
840
+ }
841
+ resetDcValueId() {
842
+ let form = this._dataview.getTask().getForm();
843
+ let mgControl = null;
844
+ if (form != null && this._dcRefs != null) {
845
+ this._dcRefs.Refs.forEach(function (dcRef) {
846
+ mgControl = form.getCtrl(dcRef.ditIdx);
847
+ if (mgControl != null)
848
+ mgControl.setDcValId(EMPTY_DCREF);
849
+ });
850
+ }
851
+ }
852
+ AddDcValuesReference(controlId, dcValuesId) {
853
+ let dcValues = this._dataview.getDcValues(dcValuesId);
854
+ let dcRef = new DcValuesReference(controlId, dcValues);
855
+ if (this._dcRefs === null) {
856
+ this._dcRefs = new ObjectReferencesCollection();
857
+ }
858
+ this._dcRefs.Add(dcRef);
859
+ }
860
+ }
861
+ export class DcValuesReference extends ObjectReferenceBase {
862
+ ditIdx = 0;
863
+ get DcValues() {
864
+ return this.Referent;
865
+ }
866
+ constructor(controlId, referencedDcValues) {
867
+ super(referencedDcValues);
868
+ this.ditIdx = controlId;
869
+ }
870
+ Clone() {
871
+ return new DcValuesReference(this.ditIdx, this.Referent);
872
+ }
873
+ static Parse(couple, dcValuesOwner) {
874
+ let commaPos = couple.indexOf(",");
875
+ let controlId = NNumber.Parse(couple.substr(0, commaPos));
876
+ let dcId = NNumber.Parse(couple.substr(commaPos + 1));
877
+ return new DcValuesReference(controlId, dcValuesOwner.getDcValues(dcId));
878
+ }
879
+ }
880
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVjb3JkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZW5naW5lL3NyYy9kYXRhL1JlY29yZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wscUJBQXFCLEVBRXJCLFdBQVcsRUFDWCxNQUFNLEVBR04sbUJBQW1CLEVBQ25CLDBCQUEwQixFQUMxQixXQUFXLEVBQ1osTUFBTSxnQkFBZ0IsQ0FBQztBQUN4QixPQUFPLEVBQ0wsb0JBQW9CLEVBRXBCLEtBQUssRUFDTCxtQkFBbUIsRUFFbkIsT0FBTyxFQUNQLE9BQU8sRUFDUCxRQUFRLEVBQ1IsYUFBYSxFQUNiLGlCQUFpQixFQU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gICAgICAgICB0aGlzLnNldElkKFhtbFBhcnNlci5nZXRJbnQodmFsdWVTdHIpKTtcclxuICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgIGNhc2UgWE1MQ29uc3RhbnRzLk1HX0FUVFJfVkJfVklFV19ST1dJRFg6XHJcbiAgICAgICAgICB0aGlzLnNldERCVmlld1Jvd0lkeChYbWxQYXJzZXIuZ2V0SW50KHZhbHVlU3RyKSk7XHJcbiAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlIFhNTENvbnN0YW50cy5NR19BVFRSX1ZBTFVFOlxyXG4gICAgICAgICAgaWYgKHRoaXMuVmFsdWVJbkJhc2U2NCkge1xyXG4gICAgICAgICAgICByZWNGaWVsZHNEYXRhID0gQmFzZTY0LmRlY29kZSh2YWx1ZVN0cik7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgcmVjRmllbGRzRGF0YSA9IFhtbFBhcnNlci51bmVzY2FwZSh2YWx1ZVN0cik7XHJcbiAgICAgICAgICB9XHJcbiAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlIENvbnN0SW50ZXJmYWNlLk1HX0FUVFJfQ1VSUl9SRUM6IHtcclxuXHJcbiAgICAgICAgfVxyXG4gICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgY2FzZSBDb25zdEludGVyZmFjZS5NR19BVFRSX0FERF9BRlRFUjpcclxuICAgICAgICAgIHRoaXMuX2FkZEFmdGVyID0gWG1sUGFyc2VyLmdldEludCh2YWx1ZVN0cik7XHJcbiAgICAgICAgICBicmVhaztcclxuICAgICAgICBjYXNlIENvbnN0SW50ZXJmYWNlLk1HX0FUVFJfRkxBR1M6XHJcbiAgICAgICAgICByZWNGbGFncyA9IHZhbHVlU3RyO1xyXG4gICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgY2FzZSBDb25zdEludGVyZmFjZS5NR19BVFRSX01PRElGSUVEOlxyXG4gICAgICAgICAgdGhpcy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