@magic-xpa/engine 4.1100.0-dev4110.25 → 4.1100.0-dev4110.252
Sign up to get free protection for your applications and to get access to all the features.
- package/{esm2020 → esm2022}/index.mjs +188 -188
- package/{esm2020 → esm2022}/magic-xpa-engine.mjs +1 -1
- package/esm2022/src/AccessHelper.mjs +15 -0
- package/esm2022/src/ClientManager.mjs +416 -0
- package/esm2022/src/CommandsProcessorBase.mjs +56 -0
- package/esm2022/src/CommandsProcessorManager.mjs +26 -0
- package/esm2022/src/CommandsTable.mjs +162 -0
- package/esm2022/src/ConstInterface.mjs +517 -0
- package/{esm2020 → esm2022}/src/CurrentClientVersion.mjs +2 -2
- package/esm2022/src/FlowMonitorInterface.mjs +16 -0
- package/esm2022/src/GUIManager.mjs +62 -0
- package/esm2022/src/GlobalCommandsManager.mjs +34 -0
- package/esm2022/src/GuiEventsProcessor.mjs +156 -0
- package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
- package/esm2022/src/ServerConfig.mjs +122 -0
- package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
- package/esm2022/src/bridge/MagicBridge.mjs +41 -0
- package/esm2022/src/commands/ClientOriginatedCommandTaskTag.mjs +12 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserLocateDataViewCommand.mjs +8 -8
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserRangeDataviewCommand.mjs +9 -9
- package/{esm2020 → esm2022}/src/commands/ClientToServer/AddUserSortDataViewCommand.mjs +9 -9
- package/esm2022/src/commands/ClientToServer/BrowserEscEventCommand.mjs +26 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
- package/esm2022/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +60 -0
- package/esm2022/src/commands/ClientToServer/ColumnSortEventCommand.mjs +29 -0
- package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +261 -0
- package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
- package/esm2022/src/commands/ClientToServer/ComputeEventCommand.mjs +26 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +24 -21
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +23 -20
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ControlItemsRefreshCommand.mjs +8 -8
- package/esm2022/src/commands/ClientToServer/DataViewOutputCommand.mjs +13 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/DataviewCommand.mjs +44 -44
- package/esm2022/src/commands/ClientToServer/EvaluateCommand.mjs +40 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/EventCommand.mjs +43 -40
- package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +70 -0
- package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +25 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
- package/esm2022/src/commands/ClientToServer/IndexChangeEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +26 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +26 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
- package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +30 -0
- package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +30 -0
- package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +43 -0
- package/esm2022/src/commands/ClientToServer/SelectProgramCommand.mjs +19 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
- package/esm2022/src/commands/ClientToServer/SubformOpenEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +34 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +18 -15
- package/esm2022/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +18 -0
- package/esm2022/src/commands/DataViewCommandBase.mjs +8 -0
- package/{esm2020 → esm2022}/src/commands/IClientCommand.mjs +1 -1
- package/esm2022/src/commands/IClientTargetedCommand.mjs +13 -0
- package/{esm2020 → esm2022}/src/commands/IClientToServerCommandInfo.mjs +2 -2
- package/esm2022/src/commands/ServerToClient/AbortCommand.mjs +65 -0
- package/{esm2020 → esm2022}/src/commands/ServerToClient/AddLocateCommand.mjs +21 -21
- package/esm2022/src/commands/ServerToClient/AddRangeCommand.mjs +62 -0
- package/esm2022/src/commands/ServerToClient/AddSortCommand.mjs +33 -0
- package/esm2022/src/commands/ServerToClient/ClientRefreshCommand.mjs +25 -0
- package/esm2022/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +24 -0
- package/esm2022/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +45 -0
- package/esm2022/src/commands/ServerToClient/OpenURLCommand.mjs +221 -0
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetLocateCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetRangeCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ServerToClient/ResetSortCommand.mjs +14 -14
- package/esm2022/src/commands/ServerToClient/ResultCommand.mjs +37 -0
- package/esm2022/src/commands/ServerToClient/VerifyCommand.mjs +83 -0
- package/esm2022/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +132 -0
- package/{esm2020 → esm2022}/src/communications/IConnectionStateManager.mjs +1 -1
- package/esm2022/src/communications/InteractiveCommunicationsFailureHandler.mjs +15 -0
- package/{esm2020 → esm2022}/src/data/DataSourceIdKey.mjs +2 -2
- package/esm2022/src/data/DataView.mjs +1613 -0
- package/{esm2020 → esm2022}/src/data/DataViewBase.mjs +3 -3
- package/esm2022/src/data/DataviewManager.mjs +28 -0
- package/esm2022/src/data/DataviewManagerBase.mjs +15 -0
- package/esm2022/src/data/DvCache.mjs +67 -0
- package/esm2022/src/data/Field.mjs +646 -0
- package/esm2022/src/data/FieldBase.mjs +15 -0
- package/esm2022/src/data/FieldsTable.mjs +103 -0
- package/{esm2020 → esm2022}/src/data/IRecordsTable.mjs +1 -1
- package/esm2022/src/data/Key.mjs +88 -0
- package/esm2022/src/data/Record.mjs +880 -0
- package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
- package/esm2022/src/data/RecordsTable.mjs +267 -0
- package/esm2022/src/data/TaskTransactionManager.mjs +107 -0
- package/esm2022/src/data/XMLBasedDcValuesBuilder.mjs +74 -0
- package/{esm2020 → esm2022}/src/enums.mjs +23 -23
- package/esm2022/src/env/EnvVariablesTable.mjs +340 -0
- package/esm2022/src/env/Environment.mjs +487 -0
- package/{esm2020 → esm2022}/src/env/ILanguageData.mjs +1 -1
- package/esm2022/src/env/LanguageData.mjs +227 -0
- package/esm2022/src/env/MirrorString.mjs +65 -0
- package/esm2022/src/event/ActionManager.mjs +91 -0
- package/esm2022/src/event/Event.mjs +1333 -0
- package/esm2022/src/event/EventHandler.mjs +766 -0
- package/esm2022/src/event/EventHandlerPosition.mjs +204 -0
- package/esm2022/src/event/EventsManager.mjs +2988 -0
- package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
- package/esm2022/src/event/RunTimeEvent.mjs +399 -0
- package/{esm2020 → esm2022}/src/event/RunTimeEventBase.mjs +3 -3
- package/esm2022/src/event/UserEventsTable.mjs +47 -0
- package/esm2022/src/exp/ExpTable.mjs +57 -0
- package/esm2022/src/exp/Expression.mjs +200 -0
- package/esm2022/src/exp/ExpressionDict.mjs +727 -0
- package/esm2022/src/exp/ExpressionEvaluator.mjs +4206 -0
- package/esm2022/src/exp/ExpressionLocalJpn.mjs +314 -0
- package/esm2022/src/exp/GlobalParamsTable.mjs +85 -0
- package/esm2022/src/exp/YesNoExp.mjs +36 -0
- package/esm2022/src/gui/CreatedFormVector.mjs +23 -0
- package/esm2022/src/gui/FormsTable.mjs +66 -0
- package/esm2022/src/gui/MgControl.mjs +363 -0
- package/esm2022/src/gui/MgForm.mjs +1224 -0
- package/esm2022/src/http/HttpManager.mjs +97 -0
- package/esm2022/src/http/client/HttpClientAsync.mjs +68 -0
- package/esm2022/src/http/client/HttpClientBase.mjs +132 -0
- package/esm2022/src/http/client/HttpClientEvents.mjs +39 -0
- package/esm2022/src/http/client/HttpClientSync.mjs +42 -0
- package/esm2022/src/http/client/HttpUtility.mjs +84 -0
- package/{esm2020 → esm2022}/src/http/client/ICommunicationsFailureHandler.mjs +1 -1
- package/esm2022/src/remote/AddUserLocateRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/AddUserRangeRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/AddUserSortRemoteDataViewCommand.mjs +18 -0
- package/esm2022/src/remote/RemoteCommandsProcessor.mjs +883 -0
- package/esm2022/src/remote/RemoteControlItemsRefreshCommand.mjs +25 -0
- package/esm2022/src/remote/RemoteDataViewCommandBase.mjs +24 -0
- package/esm2022/src/remote/RemoteDataViewCommandFactory.mjs +61 -0
- package/{esm2020 → esm2022}/src/remote/RemoteDataViewCommandUpdateNonModifiable.mjs +15 -15
- package/{esm2020 → esm2022}/src/remote/RemoteDataviewManager.mjs +17 -17
- package/{esm2020 → esm2022}/src/remote/RemoteInitDataViewCommand.mjs +10 -10
- package/esm2022/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +17 -0
- package/{esm2020 → esm2022}/src/remote/ResetUserRangeRemoteDataviewCommand.mjs +12 -12
- package/esm2022/src/remote/ResetUserSortRemoteDataviewCommand.mjs +16 -0
- package/esm2022/src/remote/ServerError.mjs +40 -0
- package/esm2022/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +20 -0
- package/esm2022/src/rt/Argument.mjs +265 -0
- package/esm2022/src/rt/ArgumentsList.mjs +103 -0
- package/esm2022/src/rt/Boundary.mjs +152 -0
- package/esm2022/src/rt/CompMainPrgTable.mjs +63 -0
- package/{esm2020 → esm2022}/src/rt/DataviewHeaderBase.mjs +98 -96
- package/{esm2020 → esm2022}/src/rt/DataviewHeaderFactory.mjs +6 -6
- package/esm2022/src/rt/DataviewHeaders.mjs +53 -0
- package/esm2022/src/rt/DataviewHeadersSaxHandler.mjs +38 -0
- package/esm2022/src/rt/ExecutionStack.mjs +94 -0
- package/{esm2020 → esm2022}/src/rt/ExecutionStackEntry.mjs +17 -17
- package/esm2022/src/rt/HandlersTable.mjs +96 -0
- package/{esm2020 → esm2022}/src/rt/IDataSourceViewDefinition.mjs +1 -1
- package/{esm2020 → esm2022}/src/rt/IDataviewHeader.mjs +1 -1
- package/{esm2020 → esm2022}/src/rt/IResultValue.mjs +1 -1
- package/esm2022/src/rt/LastFocusedManager.mjs +65 -0
- package/esm2022/src/rt/Operation.mjs +735 -0
- package/esm2022/src/rt/OperationTable.mjs +67 -0
- package/esm2022/src/rt/Recompute.mjs +355 -0
- package/esm2022/src/rt/RecomputeTable.mjs +63 -0
- package/esm2022/src/rt/RemoteDataviewHeader.mjs +108 -0
- package/esm2022/src/rt/ResultValue.mjs +10 -0
- package/esm2022/src/rt/TableCache.mjs +177 -0
- package/esm2022/src/rt/TableCacheManager.mjs +67 -0
- package/esm2022/src/rt/Transaction.mjs +53 -0
- package/esm2022/src/security/UserDetails.mjs +71 -0
- package/{esm2020 → esm2022}/src/tasks/IMGDataCollection.mjs +1 -1
- package/esm2022/src/tasks/MGData.mjs +552 -0
- package/esm2022/src/tasks/MGDataCollection.mjs +252 -0
- package/esm2022/src/tasks/RCTimer.mjs +63 -0
- package/esm2022/src/tasks/RemoteTaskService.mjs +45 -0
- package/esm2022/src/tasks/Task.mjs +2499 -0
- package/esm2022/src/tasks/TaskBase.mjs +83 -0
- package/esm2022/src/tasks/TaskServiceBase.mjs +25 -0
- package/esm2022/src/tasks/TasksTable.mjs +80 -0
- package/esm2022/src/tasks/sort/Sort.mjs +5 -0
- package/esm2022/src/tasks/sort/SortCollection.mjs +67 -0
- package/esm2022/src/util/ConstUtils.mjs +14 -0
- package/esm2022/src/util/FlowMonitorQueue.mjs +451 -0
- package/esm2022/src/util/HeapSort.mjs +70 -0
- package/{esm2020 → esm2022}/src/util/IMirrorXML.mjs +1 -1
- package/{esm2020 → esm2022}/src/util/IServerConfig.mjs +1 -1
- package/{esm2020 → esm2022}/src/util/MgBlockingQueue.mjs +1 -1
- package/esm2022/src/util/MgPriorityBlockingQueue.mjs +74 -0
- package/esm2022/src/util/MgPriorityQueue.mjs +66 -0
- package/{esm2020 → esm2022}/src/util/ParamParseResult.mjs +7 -7
- package/esm2022/src/util/PrmMap.mjs +152 -0
- package/esm2022/src/util/ReturnResult.mjs +46 -0
- package/esm2022/src/util/ReturnResultBase.mjs +18 -0
- package/esm2022/src/util/Scrambler.mjs +89 -0
- package/esm2022/src/util/UniqueIDUtils.mjs +13 -0
- package/esm2022/src/util/cookie.service.mjs +92 -0
- package/{fesm2020 → fesm2022}/magic-xpa-engine.mjs +29883 -29693
- package/fesm2022/magic-xpa-engine.mjs.map +1 -0
- package/index.d.ts +187 -187
- package/package.json +8 -14
- package/src/AccessHelper.d.ts +20 -20
- package/src/ClientManager.d.ts +35 -32
- package/src/CommandsProcessorBase.d.ts +23 -23
- package/src/CommandsProcessorManager.d.ts +6 -6
- package/src/CommandsTable.d.ts +22 -22
- package/src/ConstInterface.d.ts +516 -515
- package/src/CurrentClientVersion.d.ts +1 -1
- package/src/FlowMonitorInterface.d.ts +15 -15
- package/src/GUIManager.d.ts +17 -17
- package/src/GlobalCommandsManager.d.ts +17 -17
- package/src/GuiEventsProcessor.d.ts +24 -24
- package/src/ICommandsTable.d.ts +9 -9
- package/src/ServerConfig.d.ts +35 -34
- package/src/bridge/IGuiEvent.d.ts +19 -19
- package/src/bridge/MagicBridge.d.ts +16 -16
- package/src/commands/ClientOriginatedCommandTaskTag.d.ts +8 -8
- package/src/commands/ClientToServer/AddUserLocateDataViewCommand.d.ts +4 -4
- package/src/commands/ClientToServer/AddUserRangeDataviewCommand.d.ts +6 -6
- package/src/commands/ClientToServer/AddUserSortDataViewCommand.d.ts +6 -6
- package/src/commands/ClientToServer/BrowserEscEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/ClientOriginatedCommand.d.ts +8 -8
- package/src/commands/ClientToServer/ClientOriginatedCommandSerializer.d.ts +6 -6
- package/src/commands/ClientToServer/ColumnSortEventCommand.d.ts +11 -10
- package/src/commands/ClientToServer/CommandFactory.d.ts +64 -64
- package/src/commands/ClientToServer/CommandSerializationHelper.d.ts +20 -20
- package/src/commands/ClientToServer/ComputeEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +8 -7
- package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +8 -7
- package/src/commands/ClientToServer/ControlItemsRefreshCommand.d.ts +6 -6
- package/src/commands/ClientToServer/DataViewOutputCommand.d.ts +9 -9
- package/src/commands/ClientToServer/DataviewCommand.d.ts +32 -32
- package/src/commands/ClientToServer/EvaluateCommand.d.ts +16 -15
- package/src/commands/ClientToServer/EventCommand.d.ts +16 -15
- package/src/commands/ClientToServer/ExecOperCommand.d.ts +24 -23
- package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/GlobalParamsQueryCommand.d.ts +5 -5
- package/src/commands/ClientToServer/ICommandTaskTag.d.ts +3 -3
- package/src/commands/ClientToServer/IndexChangeEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +11 -10
- package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
- package/src/commands/ClientToServer/RecomputeCommand.d.ts +12 -11
- package/src/commands/ClientToServer/RefreshEventCommand.d.ts +13 -12
- package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +11 -10
- package/src/commands/ClientToServer/RollbackEventCommand.d.ts +15 -14
- package/src/commands/ClientToServer/SelectProgramCommand.d.ts +7 -6
- package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
- package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +9 -8
- package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +10 -9
- package/src/commands/ClientToServer/TransactionCommand.d.ts +14 -12
- package/src/commands/ClientToServer/UnloadCommand.d.ts +8 -7
- package/src/commands/ClientToServer/WriteMessageToServerLogCommand.d.ts +6 -6
- package/src/commands/DataViewCommandBase.d.ts +6 -6
- package/src/commands/IClientCommand.d.ts +2 -2
- package/src/commands/IClientTargetedCommand.d.ts +12 -12
- package/src/commands/IClientToServerCommandInfo.d.ts +4 -3
- package/src/commands/ServerToClient/AbortCommand.d.ts +11 -11
- package/src/commands/ServerToClient/AddLocateCommand.d.ts +6 -6
- package/src/commands/ServerToClient/AddRangeCommand.d.ts +10 -10
- package/src/commands/ServerToClient/AddSortCommand.d.ts +9 -9
- package/src/commands/ServerToClient/ClientRefreshCommand.d.ts +7 -7
- package/src/commands/ServerToClient/ClientTargetedCommandBase.d.ts +12 -12
- package/src/commands/ServerToClient/EnhancedVerifyCommand.d.ts +13 -13
- package/src/commands/ServerToClient/OpenURLCommand.d.ts +21 -21
- package/src/commands/ServerToClient/ResetLocateCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResetRangeCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResetSortCommand.d.ts +6 -6
- package/src/commands/ServerToClient/ResultCommand.d.ts +10 -10
- package/src/commands/ServerToClient/VerifyCommand.d.ts +17 -17
- package/src/commands/ServerToClient/XMLBasedCommandBuilder.d.ts +11 -11
- package/src/communications/IConnectionStateManager.d.ts +4 -4
- package/src/communications/InteractiveCommunicationsFailureHandler.d.ts +6 -6
- package/src/data/DataSourceIdKey.d.ts +2 -2
- package/src/data/DataView.d.ts +162 -162
- package/src/data/DataViewBase.d.ts +12 -12
- package/src/data/DataviewManager.d.ts +14 -14
- package/src/data/DataviewManagerBase.d.ts +11 -11
- package/src/data/DvCache.d.ts +15 -15
- package/src/data/Field.d.ts +103 -103
- package/src/data/FieldBase.d.ts +23 -23
- package/src/data/FieldsTable.d.ts +27 -27
- package/src/data/IRecordsTable.d.ts +7 -7
- package/src/data/Key.d.ts +15 -15
- package/src/data/Record.d.ts +157 -156
- package/src/data/RecordOutOfDataViewException.d.ts +10 -10
- package/src/data/RecordsTable.d.ts +38 -38
- package/src/data/TaskTransactionManager.d.ts +17 -17
- package/src/data/XMLBasedDcValuesBuilder.d.ts +11 -11
- package/src/enums.d.ts +21 -21
- package/src/env/EnvVariablesTable.d.ts +17 -17
- package/src/env/Environment.d.ts +118 -118
- package/src/env/ILanguageData.d.ts +3 -3
- package/src/env/LanguageData.d.ts +20 -20
- package/src/env/MirrorString.d.ts +15 -15
- package/src/event/ActionManager.d.ts +14 -14
- package/src/event/Event.d.ts +79 -79
- package/src/event/EventHandler.d.ts +66 -66
- package/src/event/EventHandlerPosition.d.ts +25 -25
- package/src/event/EventsManager.d.ts +205 -204
- package/src/event/IEventsManager.d.ts +77 -77
- package/src/event/RunTimeEvent.d.ts +126 -123
- package/src/event/RunTimeEventBase.d.ts +5 -5
- package/src/event/UserEventsTable.d.ts +11 -11
- package/src/exp/ExpTable.d.ts +11 -11
- package/src/exp/Expression.d.ts +37 -37
- package/src/exp/ExpressionDict.d.ts +12 -12
- package/src/exp/ExpressionEvaluator.d.ts +198 -198
- package/src/exp/ExpressionLocalJpn.d.ts +18 -18
- package/src/exp/GlobalParamsTable.d.ts +19 -19
- package/src/exp/YesNoExp.d.ts +9 -9
- package/src/gui/CreatedFormVector.d.ts +10 -10
- package/src/gui/FormsTable.d.ts +15 -15
- package/src/gui/MgControl.d.ts +60 -60
- package/src/gui/MgForm.d.ts +96 -93
- package/src/http/HttpManager.d.ts +25 -25
- package/src/http/client/HttpClientAsync.d.ts +16 -16
- package/src/http/client/HttpClientBase.d.ts +30 -30
- package/src/http/client/HttpClientEvents.d.ts +18 -18
- package/src/http/client/HttpClientSync.d.ts +17 -17
- package/src/http/client/HttpUtility.d.ts +10 -10
- package/src/http/client/ICommunicationsFailureHandler.d.ts +5 -5
- package/src/remote/AddUserLocateRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/AddUserRangeRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/AddUserSortRemoteDataViewCommand.d.ts +8 -8
- package/src/remote/RemoteCommandsProcessor.d.ts +51 -51
- package/src/remote/RemoteControlItemsRefreshCommand.d.ts +8 -8
- package/src/remote/RemoteDataViewCommandBase.d.ts +10 -10
- package/src/remote/RemoteDataViewCommandFactory.d.ts +6 -6
- package/src/remote/RemoteDataViewCommandUpdateNonModifiable.d.ts +8 -8
- package/src/remote/RemoteDataviewManager.d.ts +9 -9
- package/src/remote/RemoteInitDataViewCommand.d.ts +7 -7
- package/src/remote/ResetUserLocateRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ResetUserRangeRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ResetUserSortRemoteDataviewCommand.d.ts +7 -7
- package/src/remote/ServerError.d.ts +16 -16
- package/src/remote/SetTransactionStateRemoteDataViewCommand.d.ts +8 -8
- package/src/rt/Argument.d.ts +36 -36
- package/src/rt/ArgumentsList.d.ts +24 -24
- package/src/rt/Boundary.d.ts +27 -27
- package/src/rt/CompMainPrgTable.d.ts +10 -10
- package/src/rt/DataviewHeaderBase.d.ts +34 -34
- package/src/rt/DataviewHeaderFactory.d.ts +5 -5
- package/src/rt/DataviewHeaders.d.ts +12 -12
- package/src/rt/DataviewHeadersSaxHandler.d.ts +10 -10
- package/src/rt/ExecutionStack.d.ts +22 -22
- package/src/rt/ExecutionStackEntry.d.ts +7 -7
- package/src/rt/HandlersTable.d.ts +19 -19
- package/src/rt/IDataSourceViewDefinition.d.ts +6 -6
- package/src/rt/IDataviewHeader.d.ts +10 -10
- package/src/rt/IResultValue.d.ts +4 -4
- package/src/rt/LastFocusedManager.d.ts +23 -23
- package/src/rt/Operation.d.ts +97 -97
- package/src/rt/OperationTable.d.ts +15 -15
- package/src/rt/Recompute.d.ts +41 -41
- package/src/rt/RecomputeTable.d.ts +9 -9
- package/src/rt/RemoteDataviewHeader.d.ts +14 -14
- package/src/rt/ResultValue.d.ts +7 -7
- package/src/rt/TableCache.d.ts +29 -29
- package/src/rt/TableCacheManager.d.ts +10 -10
- package/src/rt/Transaction.d.ts +23 -23
- package/src/security/UserDetails.d.ts +16 -16
- package/src/tasks/IMGDataCollection.d.ts +26 -26
- package/src/tasks/MGData.d.ts +63 -63
- package/src/tasks/MGDataCollection.d.ts +42 -42
- package/src/tasks/RCTimer.d.ts +13 -13
- package/src/tasks/RemoteTaskService.d.ts +16 -16
- package/src/tasks/Task.d.ts +312 -312
- package/src/tasks/TaskBase.d.ts +123 -123
- package/src/tasks/TaskServiceBase.d.ts +16 -16
- package/src/tasks/TasksTable.d.ts +21 -21
- package/src/tasks/sort/Sort.d.ts +4 -4
- package/src/tasks/sort/SortCollection.d.ts +11 -11
- package/src/util/ConstUtils.d.ts +3 -3
- package/src/util/FlowMonitorQueue.d.ts +70 -70
- package/src/util/HeapSort.d.ts +6 -6
- package/src/util/IMirrorXML.d.ts +6 -6
- package/src/util/IServerConfig.d.ts +11 -11
- package/src/util/MgBlockingQueue.d.ts +5 -5
- package/src/util/MgPriorityBlockingQueue.d.ts +17 -17
- package/src/util/MgPriorityQueue.d.ts +13 -13
- package/src/util/ParamParseResult.d.ts +6 -6
- package/src/util/PrmMap.d.ts +28 -28
- package/src/util/ReturnResult.d.ts +18 -18
- package/src/util/ReturnResultBase.d.ts +11 -11
- package/src/util/Scrambler.d.ts +10 -10
- package/src/util/UniqueIDUtils.d.ts +4 -4
- package/src/util/cookie.service.d.ts +8 -8
- package/esm2020/src/AccessHelper.mjs +0 -9
- package/esm2020/src/ClientManager.mjs +0 -399
- package/esm2020/src/CommandsProcessorBase.mjs +0 -58
- package/esm2020/src/CommandsProcessorManager.mjs +0 -26
- package/esm2020/src/CommandsTable.mjs +0 -162
- package/esm2020/src/ConstInterface.mjs +0 -516
- package/esm2020/src/FlowMonitorInterface.mjs +0 -16
- package/esm2020/src/GUIManager.mjs +0 -62
- package/esm2020/src/GlobalCommandsManager.mjs +0 -34
- package/esm2020/src/GuiEventsProcessor.mjs +0 -154
- package/esm2020/src/ServerConfig.mjs +0 -117
- package/esm2020/src/bridge/MagicBridge.mjs +0 -41
- package/esm2020/src/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
- package/esm2020/src/commands/ClientToServer/BrowserEscEventCommand.mjs +0 -23
- package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
- package/esm2020/src/commands/ClientToServer/ColumnSortEventCommand.mjs +0 -26
- package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
- package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
- package/esm2020/src/commands/ClientToServer/ComputeEventCommand.mjs +0 -23
- package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
- package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
- package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
- package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
- package/esm2020/src/commands/ClientToServer/IndexChangeEventCommand.mjs +0 -21
- package/esm2020/src/commands/ClientToServer/IniputForceWriteCommand.mjs +0 -23
- package/esm2020/src/commands/ClientToServer/RecomputeCommand.mjs +0 -27
- package/esm2020/src/commands/ClientToServer/RefreshEventCommand.mjs +0 -27
- package/esm2020/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +0 -24
- package/esm2020/src/commands/ClientToServer/RollbackEventCommand.mjs +0 -39
- package/esm2020/src/commands/ClientToServer/SelectProgramCommand.mjs +0 -15
- package/esm2020/src/commands/ClientToServer/SubformOpenEventCommand.mjs +0 -21
- package/esm2020/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +0 -24
- package/esm2020/src/commands/ClientToServer/TransactionCommand.mjs +0 -28
- package/esm2020/src/commands/ClientToServer/WriteMessageToServerLogCommand.mjs +0 -18
- package/esm2020/src/commands/DataViewCommandBase.mjs +0 -10
- package/esm2020/src/commands/IClientTargetedCommand.mjs +0 -9
- package/esm2020/src/commands/ServerToClient/AbortCommand.mjs +0 -65
- package/esm2020/src/commands/ServerToClient/AddRangeCommand.mjs +0 -62
- package/esm2020/src/commands/ServerToClient/AddSortCommand.mjs +0 -33
- package/esm2020/src/commands/ServerToClient/ClientRefreshCommand.mjs +0 -25
- package/esm2020/src/commands/ServerToClient/ClientTargetedCommandBase.mjs +0 -27
- package/esm2020/src/commands/ServerToClient/EnhancedVerifyCommand.mjs +0 -45
- package/esm2020/src/commands/ServerToClient/OpenURLCommand.mjs +0 -221
- package/esm2020/src/commands/ServerToClient/ResultCommand.mjs +0 -37
- package/esm2020/src/commands/ServerToClient/VerifyCommand.mjs +0 -83
- package/esm2020/src/commands/ServerToClient/XMLBasedCommandBuilder.mjs +0 -132
- package/esm2020/src/communications/InteractiveCommunicationsFailureHandler.mjs +0 -17
- package/esm2020/src/data/DataView.mjs +0 -1610
- package/esm2020/src/data/DataviewManager.mjs +0 -28
- package/esm2020/src/data/DataviewManagerBase.mjs +0 -15
- package/esm2020/src/data/DvCache.mjs +0 -67
- package/esm2020/src/data/Field.mjs +0 -646
- package/esm2020/src/data/FieldBase.mjs +0 -18
- package/esm2020/src/data/FieldsTable.mjs +0 -103
- package/esm2020/src/data/Key.mjs +0 -88
- package/esm2020/src/data/Record.mjs +0 -846
- package/esm2020/src/data/RecordsTable.mjs +0 -267
- package/esm2020/src/data/TaskTransactionManager.mjs +0 -103
- package/esm2020/src/data/XMLBasedDcValuesBuilder.mjs +0 -74
- package/esm2020/src/env/EnvVariablesTable.mjs +0 -340
- package/esm2020/src/env/Environment.mjs +0 -489
- package/esm2020/src/env/LanguageData.mjs +0 -226
- package/esm2020/src/env/MirrorString.mjs +0 -65
- package/esm2020/src/event/ActionManager.mjs +0 -91
- package/esm2020/src/event/Event.mjs +0 -1333
- package/esm2020/src/event/EventHandler.mjs +0 -766
- package/esm2020/src/event/EventHandlerPosition.mjs +0 -204
- package/esm2020/src/event/EventsManager.mjs +0 -2975
- package/esm2020/src/event/RunTimeEvent.mjs +0 -392
- package/esm2020/src/event/UserEventsTable.mjs +0 -47
- package/esm2020/src/exp/ExpTable.mjs +0 -59
- package/esm2020/src/exp/Expression.mjs +0 -200
- package/esm2020/src/exp/ExpressionDict.mjs +0 -727
- package/esm2020/src/exp/ExpressionEvaluator.mjs +0 -4212
- package/esm2020/src/exp/ExpressionLocalJpn.mjs +0 -314
- package/esm2020/src/exp/GlobalParamsTable.mjs +0 -85
- package/esm2020/src/exp/YesNoExp.mjs +0 -36
- package/esm2020/src/gui/CreatedFormVector.mjs +0 -23
- package/esm2020/src/gui/FormsTable.mjs +0 -66
- package/esm2020/src/gui/MgControl.mjs +0 -353
- package/esm2020/src/gui/MgForm.mjs +0 -1181
- package/esm2020/src/http/HttpManager.mjs +0 -97
- package/esm2020/src/http/client/HttpClientAsync.mjs +0 -67
- package/esm2020/src/http/client/HttpClientBase.mjs +0 -132
- package/esm2020/src/http/client/HttpClientEvents.mjs +0 -39
- package/esm2020/src/http/client/HttpClientSync.mjs +0 -42
- package/esm2020/src/http/client/HttpUtility.mjs +0 -84
- package/esm2020/src/remote/AddUserLocateRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/AddUserRangeRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/AddUserSortRemoteDataViewCommand.mjs +0 -18
- package/esm2020/src/remote/RemoteCommandsProcessor.mjs +0 -880
- package/esm2020/src/remote/RemoteControlItemsRefreshCommand.mjs +0 -25
- package/esm2020/src/remote/RemoteDataViewCommandBase.mjs +0 -24
- package/esm2020/src/remote/RemoteDataViewCommandFactory.mjs +0 -61
- package/esm2020/src/remote/ResetUserLocateRemoteDataviewCommand.mjs +0 -17
- package/esm2020/src/remote/ResetUserSortRemoteDataviewCommand.mjs +0 -16
- package/esm2020/src/remote/ServerError.mjs +0 -40
- package/esm2020/src/remote/SetTransactionStateRemoteDataViewCommand.mjs +0 -20
- package/esm2020/src/rt/Argument.mjs +0 -265
- package/esm2020/src/rt/ArgumentsList.mjs +0 -103
- package/esm2020/src/rt/Boundary.mjs +0 -152
- package/esm2020/src/rt/CompMainPrgTable.mjs +0 -65
- package/esm2020/src/rt/DataviewHeaders.mjs +0 -53
- package/esm2020/src/rt/DataviewHeadersSaxHandler.mjs +0 -38
- package/esm2020/src/rt/ExecutionStack.mjs +0 -94
- package/esm2020/src/rt/HandlersTable.mjs +0 -96
- package/esm2020/src/rt/LastFocusedManager.mjs +0 -67
- package/esm2020/src/rt/Operation.mjs +0 -735
- package/esm2020/src/rt/OperationTable.mjs +0 -67
- package/esm2020/src/rt/Recompute.mjs +0 -355
- package/esm2020/src/rt/RecomputeTable.mjs +0 -63
- package/esm2020/src/rt/RemoteDataviewHeader.mjs +0 -108
- package/esm2020/src/rt/ResultValue.mjs +0 -12
- package/esm2020/src/rt/TableCache.mjs +0 -177
- package/esm2020/src/rt/TableCacheManager.mjs +0 -67
- package/esm2020/src/rt/Transaction.mjs +0 -53
- package/esm2020/src/security/UserDetails.mjs +0 -71
- package/esm2020/src/tasks/MGData.mjs +0 -552
- package/esm2020/src/tasks/MGDataCollection.mjs +0 -252
- package/esm2020/src/tasks/RCTimer.mjs +0 -63
- package/esm2020/src/tasks/RemoteTaskService.mjs +0 -45
- package/esm2020/src/tasks/Task.mjs +0 -2495
- package/esm2020/src/tasks/TaskBase.mjs +0 -87
- package/esm2020/src/tasks/TaskServiceBase.mjs +0 -25
- package/esm2020/src/tasks/TasksTable.mjs +0 -80
- package/esm2020/src/tasks/sort/Sort.mjs +0 -7
- package/esm2020/src/tasks/sort/SortCollection.mjs +0 -67
- package/esm2020/src/util/ConstUtils.mjs +0 -14
- package/esm2020/src/util/FlowMonitorQueue.mjs +0 -453
- package/esm2020/src/util/HeapSort.mjs +0 -70
- package/esm2020/src/util/MgPriorityBlockingQueue.mjs +0 -74
- package/esm2020/src/util/MgPriorityQueue.mjs +0 -66
- package/esm2020/src/util/PrmMap.mjs +0 -151
- package/esm2020/src/util/ReturnResult.mjs +0 -46
- package/esm2020/src/util/ReturnResultBase.mjs +0 -18
- package/esm2020/src/util/Scrambler.mjs +0 -89
- package/esm2020/src/util/UniqueIDUtils.mjs +0 -12
- package/esm2020/src/util/cookie.service.mjs +0 -92
- package/fesm2015/magic-xpa-engine.mjs +0 -30835
- package/fesm2015/magic-xpa-engine.mjs.map +0 -1
- package/fesm2020/magic-xpa-engine.mjs.map +0 -1
@@ -0,0 +1,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 (!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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVjb3JkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZW5naW5lL3NyYy9kYXRhL1JlY29yZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wscUJBQXFC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IH1cclxuICAgICAgICAvLyBib3RoIGFyZSBub3QgbnVsbFxyXG4gICAgICAgIGVsc2Uge1xyXG4gICAgICAgICAgdHJ5IHtcclxuICAgICAgICAgICAgbGV0IGZpcnN0ID0gbmV3IEV4cFZhbChjdXJyRmxkLmdldFR5cGUoKSwgZmFsc2UsXHJcbiAgICAgICAgICAgICAgdGhpcy5HZXRGaWVsZFZhbHVlKGN1cnJGbGRJZCkpO1xyXG4gICAgICAgICAgICBsZXQgc2Vjb25kID0gbmV3IEV4cFZhbChjdXJyRmxkLmdldFR5cGUoKSwgZmFsc2UsXHJcbiAgICAgICAgICAgICAgY29tcFRvLkdldEZpZWxkVmFsdWUoY3VyckZsZElkKSk7XHJcblxyXG4gICAgICAgICAgICByZXMgPSBFeHByZXNzaW9uRXZhbHVhdG9yLnZhbF9jbXBfYW55KGZpcnN0LCBzZWNvbmQpO1xyXG5cclxuICAgICAgICAgICAgaWYgKHJlcyAhPT0gMClcclxuICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgIH1cclxuICAgICAgICAgIGNhdGNoIChlcnIpXHJcbiAgICAgICAgICAgIC8vIG9uZSBvZiB0aGUgdmFsdWVzIHdlIGFyZSBjb21wYXJpbmcgdXNpbmcgdmxfY21wX2FueSAgaXMgbnVsbCB3ZSBzaG91bGQgbmV2ZXIgZ2V0IGhlcmVcclxuICAgICAgICAgIHtcclxuICAgICAgICAgICAgaWYgKGVyciBpbnN0YW5jZW9mIE51bGxWYWx1ZUV4Y2VwdGlvbilcclxuICAgICAgICAgICAgICBMb2dnZXIuSW5zdGFuY2UuV3JpdGVFeGNlcHRpb25Ub0xvZ1dpdGhNc2coXCIgaW4gUmVjb3JkLkNvbXBhcmVUbyBudWxsIHZhbHVlIHdhcyByZWFjaGVkXCIpO1xyXG4gICAgICAgICAgfVxyXG5cclxuICAgICAgICB9XHJcbiAgICAgIH1cclxuICAgICAgcmV0dXJuIHJlcztcclxuICAgIH1cclxuICAgIGVsc2Uge1xyXG4gIC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