@magic-xpa/engine 4.1000.0-dev4100.107 → 4.1000.0-dev4100.109

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { __awaiter } from 'tslib';
2
2
  import { StringBuilder, Int32, NString, ApplicationException, NNumber, List, Debug, Char, RefParam, NumberStyles, HashUtils, DateTime, Dictionary, Stack, NChar, isNullOrUndefined, WebException, Thread, Encoding, Exception, isUndefined, Hashtable, NotImplementedException, Array_Enumerator, ISO_8859_1_Encoding, Int64 } from '@magic-xpa/mscorelib';
3
3
  import { XMLConstants, StorageAttribute, ViewRefreshMode, InternalInterface, Logger, StorageAttributeCheck, StrUtil, SubformType, TableBehaviour, MgControlType, ScrollBarThumbType, ForceExit, XmlParser, Misc, Base64, Priority, SyncExecutionHelper, Queue, Constants, DateTimeUtils, Logger_LogLevels, Logger_MessageDirection, MsgInterface, RequestInfo, OSEnvironment, JSON_Utils, UtilDateJpn, UtilStrByteMode, PICInterface, WindowType, BrkScope, RaiseAt, CtrlButtonTypeGui } from '@magic-xpa/utils';
4
- import { RecordUtils, GuiFieldBase, ExpVal, BlobType, FieldDef, GuiTaskBase, MgControlBase, PropInterface, GuiDataCollection, CommandType, Commands, HtmlProperties, ControlTable, Modifiers, KeyboardItem, TaskDefinitionIdTableSaxHandler, DisplayConvertor, VectorType, PIC, MgTimer, GuiConstants, RuntimeContextBase, UsernamePasswordCredentials, Styles, Manager, NUM_TYPE, GuiExpressionEvaluator, ExpressionInterface, DataModificationTypes, GuiDataViewBase, ObjectReferencesCollection, EMPTY_DCREF, ObjectReferenceBase, PropTable, FieldsTable as FieldsTable$1, DcValuesBuilderBase, MgFormBase, GuiEnvironment, TaskDefinitionId, Events, Helps, FocusManager, EventsProcessor, UIBridge } from '@magic-xpa/gui';
4
+ import { RecordUtils, GuiFieldBase, ExpVal, BlobType, FieldDef, GuiTaskBase, MgControlBase, PropInterface, GuiDataCollection, CommandType, Commands, HtmlProperties, ControlTable, Modifiers, KeyboardItem, TaskDefinitionIdTableSaxHandler, DisplayConvertor, MgTimer, GuiConstants, RuntimeContextBase, UsernamePasswordCredentials, Styles, Manager, NUM_TYPE, VectorType, GuiExpressionEvaluator, ExpressionInterface, PIC, DataModificationTypes, GuiDataViewBase, ObjectReferencesCollection, EMPTY_DCREF, ObjectReferenceBase, PropTable, FieldsTable as FieldsTable$1, DcValuesBuilderBase, MgFormBase, GuiEnvironment, TaskDefinitionId, Events, Helps, FocusManager, EventsProcessor, UIBridge } from '@magic-xpa/gui';
5
5
  import { HttpHeaders, HttpErrorResponse } from '@angular/common/http';
6
6
  import { timer, Subject } from 'rxjs';
7
7
 
@@ -272,7 +272,6 @@ ConstInterface.MG_ATTR_LOCAL_AS400SET = "local_as400set";
272
272
  ConstInterface.MG_ATTR_LOCAL_EXTRA_GENGO = "local_extraGengo";
273
273
  ConstInterface.MG_ATTR_LOCAL_FLAGS = "local_flags";
274
274
  ConstInterface.MG_ATTR_SPEACIAL_ANSI_EXP = "SpecialAnsiExpression";
275
- ConstInterface.MG_ATTR_SPECIAL_IMMEDIATE_HANDLER_END = "SpecialImmediateHandlerEnd";
276
275
  ConstInterface.MG_ATTR_SPECIAL_SHOW_STATUSBAR_PANES = "SpecialShowStatusBarPanes";
277
276
  ConstInterface.MG_ATTR_SPECIAL_ROUTE_TO_ROOT_PROG_ON_CONTEXT_RECREATION = "SpecialRouteToRootProgramOnContextRecreation";
278
277
  ConstInterface.MG_ATTR_SPECIAL_SPECIAL_EDIT_LEFT_ALIGN = "SpecialEditLeftAlign";
@@ -477,7 +476,6 @@ ConstInterface.RC_TOKEN_DATA = "DATA=";
477
476
  ConstInterface.WEBCLIENT_REINITIALIZE_REQUEST = "WCREINITIALIZEREQUEST=Y";
478
477
  ConstInterface.MAIN_PROG_VIEW = "MainProgramsDataView";
479
478
  ConstInterface.GLOBAL_PARAM_LIST = "GlobalParamList";
480
- ConstInterface.ENV_VAR_LIST = "EnvVarList";
481
479
  ConstInterface.LAST_EXCEPTION = "LastException";
482
480
  ConstInterface.CTX_REMOVED_FROM_SRVR = "CtxRemovedFromSrvr";
483
481
  ConstInterface.LAST_ROUTE_EVENT = "LastRouteEvent";
@@ -3639,17 +3637,7 @@ class FlowMonitorQueue {
3639
3637
  this._isRecompute = false;
3640
3638
  this._isTask = false;
3641
3639
  this._isTaskFlow = false;
3642
- this._isDataView = false;
3643
3640
  this.ShouldSerialize = false;
3644
- this.padRight = (string, length, character = ' ') => {
3645
- let result = "";
3646
- let totalLength = length - string.length;
3647
- for (let i = 0; i < totalLength; i++) {
3648
- result = character + result;
3649
- }
3650
- result = result + string;
3651
- return result;
3652
- };
3653
3641
  }
3654
3642
  static get Instance() {
3655
3643
  if (FlowMonitorQueue._instance === null)
@@ -3707,9 +3695,6 @@ class FlowMonitorQueue {
3707
3695
  case ConstInterface.MG_ATTR_TASKFLW:
3708
3696
  this._isTaskFlow = XmlParser.getBoolean(valueStr);
3709
3697
  break;
3710
- case ConstInterface.MG_TAG_DATAVIEW:
3711
- this._isDataView = XmlParser.getBoolean(valueStr);
3712
- break;
3713
3698
  case ConstInterface.MG_ATTR_RECOMP:
3714
3699
  this._isRecompute = XmlParser.getBoolean(valueStr);
3715
3700
  break;
@@ -3767,92 +3752,6 @@ class FlowMonitorQueue {
3767
3752
  Logger.Instance.WriteSupportToLog(taskInfo + ": " + info, true);
3768
3753
  }
3769
3754
  }
3770
- appendVirtualsAndParameters(currentValues) {
3771
- let act = new ActivityItem(this, FlowMonitorQueue.ACT_TASK_FLW, InternalInterface.MG_ACT_REC_PREFIX);
3772
- act.setInfo(currentValues);
3773
- this._queue.put(act);
3774
- }
3775
- addDataViewFlow(task) {
3776
- if (this._isDataView) {
3777
- let fldTab = task.DataView.GetFieldsTab();
3778
- let preparedDisplayString = "";
3779
- let finaldisplayData = "\n";
3780
- let fldValue;
3781
- let data = "";
3782
- for (let i = 0; i < fldTab.getSize(); i++) {
3783
- let fldDef = fldTab.getField(i);
3784
- if (!fldDef.IsEventHandlerField && (fldDef.IsVirtual && !fldDef.VirAsReal) || fldDef.isParam()) {
3785
- fldValue = fldDef.isNull() ? fldDef.getNullValue() : fldDef.getValue(true);
3786
- data = this.getFieldData(fldDef.getType(), fldValue, fldDef.getPicture(), fldDef.getCellsType(), task);
3787
- preparedDisplayString = this.PrepareDisplayString(fldDef.isParam(), fldDef.getVarName(), data, true);
3788
- finaldisplayData = finaldisplayData + preparedDisplayString + "\n";
3789
- }
3790
- }
3791
- this.appendVirtualsAndParameters(finaldisplayData);
3792
- }
3793
- }
3794
- getFieldData(Storagetype, data, picture, vecCellType, task) {
3795
- switch (Storagetype) {
3796
- case StorageAttribute.DOTNET:
3797
- data = FlowMonitorQueue.UNPRINTABLE_STR_LOG;
3798
- break;
3799
- case StorageAttribute.BLOB:
3800
- {
3801
- let contentType = BlobType.getContentType(data);
3802
- if (contentType == BlobType.CONTENT_TYPE_ANSI || contentType == BlobType.CONTENT_TYPE_UNICODE)
3803
- data = data != null ? BlobType.getString(data) : "";
3804
- else
3805
- data = FlowMonitorQueue.UNPRINTABLE_STR_LOG;
3806
- }
3807
- break;
3808
- case StorageAttribute.NUMERIC:
3809
- case StorageAttribute.DATE:
3810
- case StorageAttribute.TIME:
3811
- let conv = DisplayConvertor.Instance;
3812
- data = conv.mg2disp(data, " ", new PIC(picture, Storagetype, task.getCompIdx()), false, task.getCompIdx(), false);
3813
- break;
3814
- case StorageAttribute.BLOB_VECTOR:
3815
- let vecOutData;
3816
- if (data == null) {
3817
- vecOutData = "[]";
3818
- }
3819
- else {
3820
- let cellAtt = vecCellType;
3821
- let vector = new VectorType(data);
3822
- if (cellAtt == StorageAttribute.BLOB && !VectorType.validateBlobContents(data))
3823
- vecOutData = "[]";
3824
- else {
3825
- let vecSize = VectorType.getVecSize(data);
3826
- let cellPicture = (cellAtt == StorageAttribute.NUMERIC || cellAtt == StorageAttribute.DATE || cellAtt == StorageAttribute.TIME) ? PIC.buildPicture(cellAtt, vector.getVecCell(1), task.getCompIdx(), true).getFormat() : picture;
3827
- vecOutData = "[";
3828
- for (let i = 0; i < vecSize; i++) {
3829
- vecOutData += this.getFieldData(cellAtt, vector.getVecCell(i + 1), cellPicture, vecCellType, task);
3830
- vecOutData += i < vecSize - 1 ? "," : "]";
3831
- }
3832
- }
3833
- }
3834
- data = vecOutData;
3835
- break;
3836
- case StorageAttribute.BOOLEAN:
3837
- data = data == "1" ? "TRUE" : "FALSE";
3838
- break;
3839
- }
3840
- return data;
3841
- }
3842
- PrepareDisplayString(mode, name, valueContent, addDoubleQuotes) {
3843
- let str = "";
3844
- let finalStringToDisplay = "";
3845
- if (addDoubleQuotes)
3846
- finalStringToDisplay = finalStringToDisplay + "\"";
3847
- finalStringToDisplay = finalStringToDisplay + name;
3848
- if (addDoubleQuotes)
3849
- finalStringToDisplay = finalStringToDisplay + "\"";
3850
- let paddedName = this.padRight(name, 34);
3851
- let formatOfStringVirtual = `Virtual`;
3852
- let formatOfStringParameter = `Parameter`;
3853
- str = (mode ? formatOfStringParameter : formatOfStringVirtual) + " : " + `${paddedName}` + " : " + `${valueContent}`;
3854
- return str;
3855
- }
3856
3755
  addTaskFlowRec(id, state, taskInfo) {
3857
3756
  if (this._enabled && this._isTaskFlow) {
3858
3757
  let info;
@@ -4019,7 +3918,6 @@ class FlowMonitorQueue {
4019
3918
  }
4020
3919
  }
4021
3920
  FlowMonitorQueue._instance = null;
4022
- FlowMonitorQueue.UNPRINTABLE_STR_LOG = "#UNPRINTABLE#";
4023
3921
  FlowMonitorQueue.S_EVENT_STR1 = ">>Starts ";
4024
3922
  FlowMonitorQueue.S_EVENT_STR2 = " Event";
4025
3923
  FlowMonitorQueue.S_EVENT_PROPAGATED = "Event was propagated";
@@ -5376,12 +5274,10 @@ class RemoteCommandsProcessor extends CommandsProcessorBase {
5376
5274
  return __awaiter(this, void 0, void 0, function* () {
5377
5275
  let mainPrgViewStringForServer = yield this.BuildXMLForMainProgramDataView();
5378
5276
  let globalParamsString = AccessHelper.globalParams.mirrorAllToXML();
5379
- let changedEnvVarList = AccessHelper.envParamsTable.mirrorAllToXML();
5380
5277
  let dataStorage = window.localStorage;
5381
5278
  dataStorage.setItem(ConstInterface.IS_SESSION_REINITIALIZING, "true");
5382
5279
  dataStorage.setItem(ConstInterface.MAIN_PROG_VIEW, mainPrgViewStringForServer.toString());
5383
5280
  dataStorage.setItem(ConstInterface.GLOBAL_PARAM_LIST, globalParamsString);
5384
- dataStorage.setItem(ConstInterface.ENV_VAR_LIST, changedEnvVarList);
5385
5281
  dataStorage.setItem(ConstInterface.LAST_EXCEPTION, RemoteCommandsProcessor.lastExceptionMessage);
5386
5282
  if (RuntimeContextBase.Instance.RemovedContextFromServer)
5387
5283
  dataStorage.setItem(ConstInterface.CTX_REMOVED_FROM_SRVR, "1");
@@ -5618,7 +5514,6 @@ class RemoteCommandsProcessor extends CommandsProcessorBase {
5618
5514
  let reqBuf;
5619
5515
  let isInitialCall = sessionStage === CommandsProcessorBase_SessionStage.INITIAL;
5620
5516
  let globalParamsString = null;
5621
- let envVarsString = null;
5622
5517
  if (this.DelayCommandExecution)
5623
5518
  return;
5624
5519
  if (Logger.Instance.LogLevel == Logger_LogLevels.RequestInfo && !isInitialCall)
@@ -5644,16 +5539,12 @@ class RemoteCommandsProcessor extends CommandsProcessorBase {
5644
5539
  let buffer = new StringBuilder();
5645
5540
  if (!RemoteCommandsProcessor.IsSessionReInitializing)
5646
5541
  buffer.Append(reqBuf);
5647
- if (RemoteCommandsProcessor.IsSessionReInitializing) {
5542
+ if (RemoteCommandsProcessor.IsSessionReInitializing)
5648
5543
  globalParamsString = this.RestoreSessionReInitializingDataFromLocalStorage(ConstInterface.GLOBAL_PARAM_LIST);
5649
- envVarsString = this.RestoreSessionReInitializingDataFromLocalStorage(ConstInterface.ENV_VAR_LIST);
5650
- }
5651
- else {
5544
+ else
5652
5545
  globalParamsString = AccessHelper.globalParams.mirrorToXML();
5653
- envVarsString = AccessHelper.envParamsTable.mirrorToXML();
5654
- }
5655
5546
  changes.Append(globalParamsString);
5656
- changes.Append(envVarsString);
5547
+ changes.Append(AccessHelper.envParamsTable.mirrorToXML());
5657
5548
  if (changes.Length > 0) {
5658
5549
  changes.Insert(0, "<" + ConstInterface.MG_TAG_ENV_CHANGES + ">");
5659
5550
  changes.Append("</" + ConstInterface.MG_TAG_ENV_CHANGES + ">");
@@ -5692,15 +5583,13 @@ class RemoteCommandsProcessor extends CommandsProcessorBase {
5692
5583
  dataStorage.removeItem(ConstInterface.IS_SESSION_REINITIALIZING);
5693
5584
  dataStorage.removeItem(ConstInterface.MAIN_PROG_VIEW);
5694
5585
  dataStorage.removeItem(ConstInterface.GLOBAL_PARAM_LIST);
5695
- dataStorage.removeItem(ConstInterface.ENV_VAR_LIST);
5696
5586
  dataStorage.removeItem(ConstInterface.LAST_EXCEPTION);
5697
5587
  }
5698
5588
  }
5699
5589
  FlowMonitorQueue.Instance.enable(false);
5700
5590
  yield this.ProcessResponse(respBuf, AccessHelper.mgDataTable.currMgdID, null, res);
5701
5591
  if (RemoteCommandsProcessor.IsSessionReInitializing) {
5702
- AccessHelper.globalParams.RestoreParams(globalParamsString);
5703
- AccessHelper.envParamsTable.RestoreParams(envVarsString);
5592
+ AccessHelper.globalParams.RestoreGlobalParams(globalParamsString);
5704
5593
  let dataStorage = window.localStorage;
5705
5594
  let ctxRemoved = dataStorage.getItem(ConstInterface.CTX_REMOVED_FROM_SRVR);
5706
5595
  if (ctxRemoved === "1") {
@@ -7626,9 +7515,6 @@ class EventHandlerPosition {
7626
7515
  case InternalInterface.MG_ACT_REC_SUFFIX:
7627
7516
  case InternalInterface.MG_ACT_CTRL_PREFIX:
7628
7517
  case InternalInterface.MG_ACT_CTRL_SUFFIX: {
7629
- if (this._rtEvt.getInternalCode() == InternalInterface.MG_ACT_REC_PREFIX) {
7630
- FlowMonitorQueue.Instance.addDataViewFlow(this._task);
7631
- }
7632
7518
  if (this._handlerIdx === -1) {
7633
7519
  for (this._handlerIdx = this._handlersTab.getSize() - 1; this._handlerIdx >= 0; this._handlerIdx--) {
7634
7520
  let handler = this._handlersTab.getHandler(this._handlerIdx);
@@ -8555,7 +8441,7 @@ class MirrorPrmMap extends PrmMap {
8555
8441
  while (this.mirrorFromXML(parser.getNextTag(), parser)) {
8556
8442
  }
8557
8443
  }
8558
- RestoreParams(xml) {
8444
+ RestoreGlobalParams(xml) {
8559
8445
  let parser = new XmlParser(xml);
8560
8446
  while (this.mirrorFromXML(parser.getNextTag(), parser)) {
8561
8447
  }
@@ -8630,7 +8516,6 @@ class Environment {
8630
8516
  this._debugMode = 0;
8631
8517
  this._significantNumSize = 0;
8632
8518
  this._specialAnsiExpression = false;
8633
- this._specialImmediatehandlerEnd = false;
8634
8519
  this._specialShowStatusBarPanes = false;
8635
8520
  this._specialRouteToRootProgOnContextRecreation = false;
8636
8521
  this._specialCancelOnCreate = false;
@@ -8784,9 +8669,6 @@ class Environment {
8784
8669
  case ConstInterface.MG_ATTR_LOCAL_FLAGS:
8785
8670
  this._localFlags = valueStr;
8786
8671
  break;
8787
- case ConstInterface.MG_ATTR_SPECIAL_IMMEDIATE_HANDLER_END:
8788
- this._specialImmediatehandlerEnd = XmlParser.getBoolean(valueStr);
8789
- break;
8790
8672
  case ConstInterface.MG_ATTR_SPEACIAL_ANSI_EXP:
8791
8673
  this._specialAnsiExpression = XmlParser.getBoolean(valueStr);
8792
8674
  break;
@@ -8993,9 +8875,6 @@ class Environment {
8993
8875
  GetLocalFlag(f) {
8994
8876
  return this._localFlags !== null && this._localFlags.indexOf(f) >= 0;
8995
8877
  }
8996
- getSpecialImmediateHandlerEnd() {
8997
- return this._specialImmediatehandlerEnd;
8998
- }
8999
8878
  getSpecialAnsiExpression() {
9000
8879
  return this._specialAnsiExpression;
9001
8880
  }
@@ -10034,7 +9913,8 @@ class MirrorString {
10034
9913
  this._reserved = false;
10035
9914
  }
10036
9915
  mirrorToXML() {
10037
- return ConstInterface.MG_ATTR_ENV_VALUE + "=\"" + XmlParser.escape(this._value) + "\"";
9916
+ return ConstInterface.MG_ATTR_ENV_VALUE + "=\"" + XmlParser.escape(this._value) + "\" " +
9917
+ ConstInterface.MG_ATTR_ENV_WRITEINI + "=F";
10038
9918
  }
10039
9919
  init(name, xmlParser) {
10040
9920
  let valueStart, valueEnd, reserveStart, paramEnd;
@@ -19792,7 +19672,11 @@ class MgForm extends MgFormBase {
19792
19672
  this.GetDataview().setTopRecIdxModified(true);
19793
19673
  try {
19794
19674
  this._suffixDone = false;
19795
- yield this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx() + size, true, false);
19675
+ let newDisplayLine = this.GetDataview().getCurrRecIdx() + size;
19676
+ if (unit === Constants.MOVE_UNIT_PAGE && this.isLineMode())
19677
+ if (newDisplayLine > this.GetDataview().getSize() - 1)
19678
+ visibleLine -= newDisplayLine - (this.GetDataview().getSize() - 1);
19679
+ yield this.setCurrRowByDisplayLine(newDisplayLine, true, false);
19796
19680
  this.GetDataview().setTopRecIdxModified(false);
19797
19681
  yield this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
19798
19682
  }
@@ -19832,7 +19716,6 @@ class MgForm extends MgFormBase {
19832
19716
  try {
19833
19717
  yield this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
19834
19718
  yield this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx() + this.getLastValidRow(), false, true);
19835
- visibleLine = this.getLastValidRow();
19836
19719
  }
19837
19720
  catch (Exception) {
19838
19721
  }
@@ -22012,10 +21895,8 @@ class EventHandler {
22012
21895
  continue;
22013
21896
  else if (this._operationTab.getOperation(oper.getBlockEnd()).getServerId() < nextOperIdx)
22014
21897
  continue;
22015
- if (!taskEnd) {
22016
- if ((yield this._task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE)) && Environment.Instance.getSpecialImmediateHandlerEnd())
22017
- break;
22018
- }
21898
+ if (!taskEnd)
21899
+ yield this._task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE);
22019
21900
  if (this._taskMgdID !== mgdID)
22020
21901
  isChangedCurrWndRef.value = true;
22021
21902
  if (!this._task.isMainProg() && this._task.isOpenWin())
@@ -30352,7 +30233,7 @@ class CommandsTable {
30352
30233
  }
30353
30234
  }
30354
30235
 
30355
- let CurrentClientVersion = '4.1000.0-dev4100.107';
30236
+ let CurrentClientVersion = '4.1000.0-dev4100.109';
30356
30237
 
30357
30238
  class ClientManager {
30358
30239
  constructor() {