@magic-xpa/engine 4.1100.0-dev4110.19 → 4.1100.0-dev4110.190
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 +399 -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 +516 -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 +154 -0
- package/{esm2020 → esm2022}/src/ICommandsTable.mjs +1 -1
- package/esm2022/src/ServerConfig.mjs +118 -0
- package/{esm2020 → esm2022}/src/bridge/IGuiEvent.mjs +19 -19
- package/{esm2020 → esm2022}/src/bridge/MagicBridge.mjs +40 -40
- 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/{esm2020 → esm2022}/src/commands/ClientToServer/BrowserEscEventCommand.mjs +23 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ClientOriginatedCommand.mjs +14 -14
- package/esm2022/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +60 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ColumnSortEventCommand.mjs +26 -26
- package/esm2022/src/commands/ClientToServer/CommandFactory.mjs +260 -0
- package/esm2022/src/commands/ClientToServer/CommandSerializationHelper.mjs +67 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ComputeEventCommand.mjs +23 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTerminationEventCommand.mjs +20 -20
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ContextTimeoutResetCommand.mjs +19 -19
- 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 +37 -0
- package/esm2022/src/commands/ClientToServer/EventCommand.mjs +40 -0
- package/esm2022/src/commands/ClientToServer/ExecOperCommand.mjs +67 -0
- package/esm2022/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +22 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/GlobalParamsQueryCommand.mjs +10 -10
- package/{esm2020 → esm2022}/src/commands/ClientToServer/ICommandTaskTag.mjs +1 -1
- package/{esm2020 → esm2022}/src/commands/ClientToServer/IndexChangeEventCommand.mjs +21 -21
- package/esm2022/src/commands/ClientToServer/IniputForceWriteCommand.mjs +23 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/NonReversibleExitEventCommand.mjs +23 -23
- package/{esm2020 → esm2022}/src/commands/ClientToServer/QueryCommand.mjs +20 -20
- package/esm2022/src/commands/ClientToServer/RecomputeCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/RefreshEventCommand.mjs +27 -0
- package/esm2022/src/commands/ClientToServer/RefreshScreenEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/RollbackEventCommand.mjs +40 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SelectProgramCommand.mjs +14 -14
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SetTransactionStateDataviewCommand.mjs +9 -9
- package/{esm2020 → esm2022}/src/commands/ClientToServer/SubformOpenEventCommand.mjs +21 -21
- package/esm2022/src/commands/ClientToServer/SubformRefreshEventCommand.mjs +24 -0
- package/esm2022/src/commands/ClientToServer/TransactionCommand.mjs +30 -0
- package/{esm2020 → esm2022}/src/commands/ClientToServer/UnloadCommand.mjs +14 -14
- 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 +1 -1
- 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 +866 -0
- package/{esm2020 → esm2022}/src/data/RecordOutOfDataViewException.mjs +15 -15
- package/esm2022/src/data/RecordsTable.mjs +267 -0
- package/esm2022/src/data/TaskTransactionManager.mjs +103 -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 +226 -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 +2975 -0
- package/{esm2020 → esm2022}/src/event/IEventsManager.mjs +6 -6
- package/esm2022/src/event/RunTimeEvent.mjs +392 -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 +1181 -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 +882 -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 +2497 -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 +29713 -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 +32 -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 +515 -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 +34 -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 +8 -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 +10 -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 +8 -8
- package/src/commands/ClientToServer/ContextTerminationEventCommand.d.ts +7 -7
- package/src/commands/ClientToServer/ContextTimeoutResetCommand.d.ts +7 -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 +15 -15
- package/src/commands/ClientToServer/EventCommand.d.ts +15 -15
- package/src/commands/ClientToServer/ExecOperCommand.d.ts +23 -23
- package/src/commands/ClientToServer/FetchDataControlValuesEventCommand.d.ts +8 -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 +8 -8
- package/src/commands/ClientToServer/IniputForceWriteCommand.d.ts +10 -10
- package/src/commands/ClientToServer/NonReversibleExitEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/QueryCommand.d.ts +8 -8
- package/src/commands/ClientToServer/RecomputeCommand.d.ts +11 -11
- package/src/commands/ClientToServer/RefreshEventCommand.d.ts +12 -12
- package/src/commands/ClientToServer/RefreshScreenEventCommand.d.ts +10 -10
- package/src/commands/ClientToServer/RollbackEventCommand.d.ts +14 -14
- package/src/commands/ClientToServer/SelectProgramCommand.d.ts +6 -6
- package/src/commands/ClientToServer/SetTransactionStateDataviewCommand.d.ts +5 -5
- package/src/commands/ClientToServer/SubformOpenEventCommand.d.ts +8 -8
- package/src/commands/ClientToServer/SubformRefreshEventCommand.d.ts +9 -9
- package/src/commands/ClientToServer/TransactionCommand.d.ts +12 -12
- package/src/commands/ClientToServer/UnloadCommand.d.ts +7 -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 +3 -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 +156 -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 +204 -204
- package/src/event/IEventsManager.d.ts +77 -77
- package/src/event/RunTimeEvent.d.ts +123 -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 +93 -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/commands/ClientOriginatedCommandTaskTag.mjs +0 -11
- package/esm2020/src/commands/ClientToServer/ClientOriginatedCommandSerializer.mjs +0 -60
- package/esm2020/src/commands/ClientToServer/CommandFactory.mjs +0 -260
- package/esm2020/src/commands/ClientToServer/CommandSerializationHelper.mjs +0 -69
- package/esm2020/src/commands/ClientToServer/DataViewOutputCommand.mjs +0 -13
- package/esm2020/src/commands/ClientToServer/EvaluateCommand.mjs +0 -36
- package/esm2020/src/commands/ClientToServer/EventCommand.mjs +0 -40
- package/esm2020/src/commands/ClientToServer/ExecOperCommand.mjs +0 -67
- package/esm2020/src/commands/ClientToServer/FetchDataControlValuesEventCommand.mjs +0 -22
- 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/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,866 @@
|
|
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
|
+
fldValsEqual(rec, fldIdx) {
|
690
|
+
let type = this.getFieldsTab().getField(fldIdx).getType();
|
691
|
+
return ExpressionEvaluator.mgValsEqual(this.GetFieldValue(fldIdx), this.IsNull(fldIdx), type, rec.GetFieldValue(fldIdx), rec.IsNull(fldIdx), type);
|
692
|
+
}
|
693
|
+
getHashKey() {
|
694
|
+
return this._hashKey;
|
695
|
+
}
|
696
|
+
setNextRec(nextRec) {
|
697
|
+
this._next = nextRec;
|
698
|
+
}
|
699
|
+
setPrevRec(prevRec) {
|
700
|
+
this._prev = prevRec;
|
701
|
+
}
|
702
|
+
getPrevRec() {
|
703
|
+
return this._prev;
|
704
|
+
}
|
705
|
+
getNextRec() {
|
706
|
+
return this._next;
|
707
|
+
}
|
708
|
+
getDcRefs() {
|
709
|
+
return this._dcRefs.Clone();
|
710
|
+
}
|
711
|
+
setDcRefs(newDcRefs) {
|
712
|
+
this.removeRecFromDc();
|
713
|
+
this._dcRefs = newDcRefs.Clone();
|
714
|
+
this.SetDcValueId();
|
715
|
+
}
|
716
|
+
realModified() {
|
717
|
+
let bRc = false;
|
718
|
+
let tabSize = this.getFieldsTab().getSize();
|
719
|
+
let j;
|
720
|
+
for (j = 0; j < tabSize; j++) {
|
721
|
+
if ((this._flags[j] & Record.FLAG_MODIFIED) === Record.FLAG_MODIFIED) {
|
722
|
+
if (!(this.getFieldsTab().getField(j).IsVirtual)) {
|
723
|
+
bRc = true;
|
724
|
+
break;
|
725
|
+
}
|
726
|
+
}
|
727
|
+
}
|
728
|
+
return bRc;
|
729
|
+
}
|
730
|
+
ToString() {
|
731
|
+
let str = new StringBuilder();
|
732
|
+
this.buildXML(str, (this._dataview.getCurrRec()).getId() === this._id, true);
|
733
|
+
return str.ToString();
|
734
|
+
}
|
735
|
+
setSendToServer(val) {
|
736
|
+
this._sendToServer = val;
|
737
|
+
}
|
738
|
+
getRecSize() {
|
739
|
+
let sum = 0;
|
740
|
+
for (let i = 0; i < this.getFieldsTab().getSize(); i = i + 1) {
|
741
|
+
let field = this.getFieldsTab().getField(i);
|
742
|
+
sum = sum + field.getSize();
|
743
|
+
}
|
744
|
+
return sum;
|
745
|
+
}
|
746
|
+
copyCrsrModifiedFlags(rec) {
|
747
|
+
let tabSize = this.getFieldsTab().getSize();
|
748
|
+
let j;
|
749
|
+
for (j = 0; j < tabSize; j++) {
|
750
|
+
this._flags[j] = rec._flags[j];
|
751
|
+
this._flags[j] = this._flags[j] & Record.FLAG_CRSR_MODIFIED;
|
752
|
+
}
|
753
|
+
}
|
754
|
+
getDbPosVal() {
|
755
|
+
return this._dbPosBase64Val;
|
756
|
+
}
|
757
|
+
buildLinksPosStr() {
|
758
|
+
let tbl = this._dataview.getTask().getDataviewHeaders();
|
759
|
+
if (tbl !== null) {
|
760
|
+
this._linksFldsPos = tbl.buildDbPosString();
|
761
|
+
}
|
762
|
+
}
|
763
|
+
setForceSaveOrg(val) {
|
764
|
+
this._forceSaveOrg = val;
|
765
|
+
}
|
766
|
+
getForceSaveOrg() {
|
767
|
+
return this._forceSaveOrg;
|
768
|
+
}
|
769
|
+
isCauseInvalidation() {
|
770
|
+
return this._causeInvalidation;
|
771
|
+
}
|
772
|
+
setCauseInvalidation(causeInvalidation) {
|
773
|
+
this._causeInvalidation = causeInvalidation;
|
774
|
+
}
|
775
|
+
isComputed() {
|
776
|
+
return this._computed;
|
777
|
+
}
|
778
|
+
setComputed(val) {
|
779
|
+
this._computed = val;
|
780
|
+
}
|
781
|
+
setInCompute(val) {
|
782
|
+
if (!val)
|
783
|
+
this.setComputed(true);
|
784
|
+
this._inCompute = val;
|
785
|
+
}
|
786
|
+
setInRecompute(val) {
|
787
|
+
this._inRecompute = val;
|
788
|
+
}
|
789
|
+
setMode(newMode) {
|
790
|
+
switch (newMode) {
|
791
|
+
case DataModificationTypes.None:
|
792
|
+
case DataModificationTypes.Insert:
|
793
|
+
case DataModificationTypes.Update:
|
794
|
+
case DataModificationTypes.Delete:
|
795
|
+
if (this._mode === DataModificationTypes.None ||
|
796
|
+
this._mode === DataModificationTypes.Update && newMode === DataModificationTypes.Delete)
|
797
|
+
this._mode = newMode;
|
798
|
+
break;
|
799
|
+
default:
|
800
|
+
Logger.Instance.WriteExceptionToLogWithMsg("in Record.setMode(): illegal mode: " + newMode);
|
801
|
+
break;
|
802
|
+
}
|
803
|
+
}
|
804
|
+
clearMode() {
|
805
|
+
this._mode = DataModificationTypes.None;
|
806
|
+
}
|
807
|
+
setOldRec() {
|
808
|
+
this._newRec = false;
|
809
|
+
}
|
810
|
+
setNewRec() {
|
811
|
+
this._newRec = true;
|
812
|
+
}
|
813
|
+
static serializeItemVal(itemVal, itemAttr, cellAttr, ToBase64) {
|
814
|
+
return RecordUtils.serializeItemVal(itemVal, itemAttr, cellAttr, ToBase64);
|
815
|
+
}
|
816
|
+
SetDcValueId() {
|
817
|
+
let form = this._dataview.getTask().getForm();
|
818
|
+
let mgControl = null;
|
819
|
+
if (form != null && this._dcRefs != null) {
|
820
|
+
this._dcRefs.Refs.forEach((dcRef) => {
|
821
|
+
mgControl = form.getCtrl(dcRef.ditIdx);
|
822
|
+
if (mgControl != null)
|
823
|
+
mgControl.setDcValId(dcRef.DcValues.getId());
|
824
|
+
});
|
825
|
+
}
|
826
|
+
}
|
827
|
+
resetDcValueId() {
|
828
|
+
let form = this._dataview.getTask().getForm();
|
829
|
+
let mgControl = null;
|
830
|
+
if (form != null && this._dcRefs != null) {
|
831
|
+
this._dcRefs.Refs.forEach(function (dcRef) {
|
832
|
+
mgControl = form.getCtrl(dcRef.ditIdx);
|
833
|
+
if (mgControl != null)
|
834
|
+
mgControl.setDcValId(EMPTY_DCREF);
|
835
|
+
});
|
836
|
+
}
|
837
|
+
}
|
838
|
+
AddDcValuesReference(controlId, dcValuesId) {
|
839
|
+
let dcValues = this._dataview.getDcValues(dcValuesId);
|
840
|
+
let dcRef = new DcValuesReference(controlId, dcValues);
|
841
|
+
if (this._dcRefs === null) {
|
842
|
+
this._dcRefs = new ObjectReferencesCollection();
|
843
|
+
}
|
844
|
+
this._dcRefs.Add(dcRef);
|
845
|
+
}
|
846
|
+
}
|
847
|
+
export class DcValuesReference extends ObjectReferenceBase {
|
848
|
+
ditIdx = 0;
|
849
|
+
get DcValues() {
|
850
|
+
return this.Referent;
|
851
|
+
}
|
852
|
+
constructor(controlId, referencedDcValues) {
|
853
|
+
super(referencedDcValues);
|
854
|
+
this.ditIdx = controlId;
|
855
|
+
}
|
856
|
+
Clone() {
|
857
|
+
return new DcValuesReference(this.ditIdx, this.Referent);
|
858
|
+
}
|
859
|
+
static Parse(couple, dcValuesOwner) {
|
860
|
+
let commaPos = couple.indexOf(",");
|
861
|
+
let controlId = NNumber.Parse(couple.substr(0, commaPos));
|
862
|
+
let dcId = NNumber.Parse(couple.substr(commaPos + 1));
|
863
|
+
return new DcValuesReference(controlId, dcValuesOwner.getDcValues(dcId));
|
864
|
+
}
|
865
|
+
}
|
866
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVjb3JkLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZW5naW5lL3NyYy9kYXRhL1JlY29yZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wscUJBQXFCLEVBRXJCLFdBQVcsRUFDWCxNQUFNLEVBR04sbUJBQW1CLEVBQ25CLDBCQUEwQixFQUMxQixXQUFXLEVBQ1osTUFBTSxnQkFBZ0IsQ0FBQztBQUN4QixPQUFPLEVBQ0wsb0JBQW9CLEVBRXBCLEtBQUssRUFDTCxtQkFBbUIsRUFFbkIsT0FBTyxFQUNQLE9BQU8sRUFDUCxRQUFRLEVBQ1IsYUFBYSxFQUNiLGlCQUFpQixFQUNsQixNQUFNLHNCQUFzQixDQUFDO0FBQzlCLE9BQU8sRUFDTCxNQUFNLEVBQ04sU0FBUyxFQUNULE1BQU0sRUFDTixnQkFBZ0IsRUFDaEIscUJBQXFCLEVBQ3JCLE9BQU8sRUFDUCxlQUFlLEVBQ2YsWUFBWSxFQUNaLFNBQVMsRUFDVixNQUFNLGtCQUFrQixDQUFDO0FBSTFCLE9BQU8sRUFBQyxtQkFBbUIsRUFBRSxrQkFBa0IsRUFBQyxNQUFNL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VtbnMubGVuZ3RoOyBpKyspIHtcclxuICAgICAgICBsZXQgY3VyckZsZCA9IGtleS5Db2x1bW5zLmdldF9JdGVtKGkpO1xyXG4gICAgICAgIGxldCBjdXJyRmxkSWQ6IG51bWJlciA9IGN1cnJGbGQuZ2V0SWQoKTtcclxuXHJcbiAgICAgICAgaWYgKHRoaXMuSXNOdWxsKGN1cnJGbGRJZCkgJiYgY29tcFRvLklzTnVsbChjdXJyRmxkSWQpKVxyXG4gICAgICAgICAgY29udGludWU7XHJcbiAgICAgICAgZWxzZSBpZiAodGhpcy5Jc051bGwoY3VyckZsZElkKSAmJiAhY29tcFRvLklzTnVsbChjdXJyRmxkSWQpKSB7XHJcbiAgICAgICAgICAvLyBudWxsIGlzIHRoZSBncmVhdGVzdCB2YWx1ZSB0aGVyZWZvcmUgd2UgYXJlIHRoZSBncmVhdGVyXHJcbiAgICAgICAgICByZXMgPSAxO1xyXG4gICAgICAgICAgYnJlYWs7XHJcbiAgICAgICAgfVxyXG4gICAgICAgIGVsc2UgaWYgKCF0aGlzLklzTnVsbChjdXJyRmxkSWQpICYmIGNvbXBUby5Jc051bGwoY3VyckZsZElkKSkge1xyXG4gICAgICAgICAgcmVzID0gLTE7XHJcbiAgICAgICAgICBicmVhaztcclxuICAgICAgICB9XHJcbiAgICAgICAgLy8gYm90aCBhcmUgbm90IG51bGxcclxuICAgICAgICBlbHNlIHtcclxuICAgICAgICAgIHRyeSB7XHJcbiAgICAgICAgICAgIGxldCBmaXJzdCA9IG5ldyBFeHBWYWwoY3VyckZsZC5nZXRUeXBlKCksIGZhbHNlLFxyXG4gICAgICAgICAgICAgIHRoaXMuR2V0RmllbGRWYWx1ZShjdXJyRmxkSWQpKTtcclxuICAgICAgICAgICAgbGV0IHNlY29uZCA9IG5ldyBFeHBWYWwoY3VyckZsZC5nZXRUeXBlKCksIGZhbHNlLFxyXG4gICAgICAgICAgICAgIGNvbXBUby5HZXRGaWVsZFZhbHVlKGN1cnJGbGRJZCkpO1xyX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