@magic-xpa/engine 4.1100.0-dev4110.19 → 4.1100.0-dev4110.191

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