@magic-xpa/engine 4.1000.0-dev4100.108 → 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,6 +1,6 @@
1
1
  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';
2
2
  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';
3
- 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';
3
+ 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';
4
4
  import { HttpHeaders, HttpErrorResponse } from '@angular/common/http';
5
5
  import { timer, Subject } from 'rxjs';
6
6
 
@@ -271,7 +271,6 @@ ConstInterface.MG_ATTR_LOCAL_AS400SET = "local_as400set";
271
271
  ConstInterface.MG_ATTR_LOCAL_EXTRA_GENGO = "local_extraGengo";
272
272
  ConstInterface.MG_ATTR_LOCAL_FLAGS = "local_flags";
273
273
  ConstInterface.MG_ATTR_SPEACIAL_ANSI_EXP = "SpecialAnsiExpression";
274
- ConstInterface.MG_ATTR_SPECIAL_IMMEDIATE_HANDLER_END = "SpecialImmediateHandlerEnd";
275
274
  ConstInterface.MG_ATTR_SPECIAL_SHOW_STATUSBAR_PANES = "SpecialShowStatusBarPanes";
276
275
  ConstInterface.MG_ATTR_SPECIAL_ROUTE_TO_ROOT_PROG_ON_CONTEXT_RECREATION = "SpecialRouteToRootProgramOnContextRecreation";
277
276
  ConstInterface.MG_ATTR_SPECIAL_SPECIAL_EDIT_LEFT_ALIGN = "SpecialEditLeftAlign";
@@ -476,7 +475,6 @@ ConstInterface.RC_TOKEN_DATA = "DATA=";
476
475
  ConstInterface.WEBCLIENT_REINITIALIZE_REQUEST = "WCREINITIALIZEREQUEST=Y";
477
476
  ConstInterface.MAIN_PROG_VIEW = "MainProgramsDataView";
478
477
  ConstInterface.GLOBAL_PARAM_LIST = "GlobalParamList";
479
- ConstInterface.ENV_VAR_LIST = "EnvVarList";
480
478
  ConstInterface.LAST_EXCEPTION = "LastException";
481
479
  ConstInterface.CTX_REMOVED_FROM_SRVR = "CtxRemovedFromSrvr";
482
480
  ConstInterface.LAST_ROUTE_EVENT = "LastRouteEvent";
@@ -3531,17 +3529,7 @@ class FlowMonitorQueue {
3531
3529
  this._isRecompute = false;
3532
3530
  this._isTask = false;
3533
3531
  this._isTaskFlow = false;
3534
- this._isDataView = false;
3535
3532
  this.ShouldSerialize = false;
3536
- this.padRight = (string, length, character = ' ') => {
3537
- let result = "";
3538
- let totalLength = length - string.length;
3539
- for (let i = 0; i < totalLength; i++) {
3540
- result = character + result;
3541
- }
3542
- result = result + string;
3543
- return result;
3544
- };
3545
3533
  }
3546
3534
  static get Instance() {
3547
3535
  if (FlowMonitorQueue._instance === null)
@@ -3599,9 +3587,6 @@ class FlowMonitorQueue {
3599
3587
  case ConstInterface.MG_ATTR_TASKFLW:
3600
3588
  this._isTaskFlow = XmlParser.getBoolean(valueStr);
3601
3589
  break;
3602
- case ConstInterface.MG_TAG_DATAVIEW:
3603
- this._isDataView = XmlParser.getBoolean(valueStr);
3604
- break;
3605
3590
  case ConstInterface.MG_ATTR_RECOMP:
3606
3591
  this._isRecompute = XmlParser.getBoolean(valueStr);
3607
3592
  break;
@@ -3659,96 +3644,6 @@ class FlowMonitorQueue {
3659
3644
  Logger.Instance.WriteSupportToLog(taskInfo + ": " + info, true);
3660
3645
  }
3661
3646
  }
3662
- appendVirtualsAndParameters(currentValues) {
3663
- let act = new ActivityItem(this, FlowMonitorQueue.ACT_TASK_FLW, InternalInterface.MG_ACT_REC_PREFIX);
3664
- act.setInfo(currentValues);
3665
- this._queue.put(act);
3666
- }
3667
- addDataViewFlow(task) {
3668
- if (this._isDataView) {
3669
- let fldTab = task.DataView.GetFieldsTab();
3670
- let preparedDisplayString = "";
3671
- let finaldisplayData = "\n";
3672
- let fldValue;
3673
- let data = "";
3674
- for (let i = 0; i < fldTab.getSize(); i++) {
3675
- let fldDef = fldTab.getField(i);
3676
- if (!fldDef.IsEventHandlerField && (fldDef.IsVirtual && !fldDef.VirAsReal) || fldDef.isParam()) {
3677
- fldValue = fldDef.isNull() ? fldDef.getNullValue() : fldDef.getValue(true);
3678
- data = this.getFieldData(fldDef.getType(), fldValue, fldDef.getPicture(), fldDef.getCellsType(), task);
3679
- preparedDisplayString = this.PrepareDisplayString(fldDef.isParam(), fldDef.getVarName(), data, true);
3680
- finaldisplayData = finaldisplayData + preparedDisplayString + "\n";
3681
- }
3682
- }
3683
- this.appendVirtualsAndParameters(finaldisplayData);
3684
- }
3685
- }
3686
- getFieldData(Storagetype, data, picture, vecCellType, task) {
3687
- switch (Storagetype) {
3688
- case StorageAttribute.DOTNET:
3689
- data = FlowMonitorQueue.UNPRINTABLE_STR_LOG;
3690
- break;
3691
- case StorageAttribute.BLOB:
3692
- {
3693
- if (BlobType.isValidBlob(data)) {
3694
- let contentType = BlobType.getContentType(data);
3695
- if (contentType == BlobType.CONTENT_TYPE_ANSI || contentType == BlobType.CONTENT_TYPE_UNICODE)
3696
- data = data != null ? BlobType.getString(data) : "";
3697
- else
3698
- data = FlowMonitorQueue.UNPRINTABLE_STR_LOG;
3699
- }
3700
- else
3701
- data = "";
3702
- }
3703
- break;
3704
- case StorageAttribute.NUMERIC:
3705
- case StorageAttribute.DATE:
3706
- case StorageAttribute.TIME:
3707
- let conv = DisplayConvertor.Instance;
3708
- data = conv.mg2disp(data, " ", new PIC(picture, Storagetype, task.getCompIdx()), false, task.getCompIdx(), false);
3709
- break;
3710
- case StorageAttribute.BLOB_VECTOR:
3711
- let vecOutData;
3712
- if (data == null) {
3713
- vecOutData = "[]";
3714
- }
3715
- else {
3716
- let cellAtt = vecCellType;
3717
- let vector = new VectorType(data);
3718
- if (cellAtt == StorageAttribute.BLOB && !VectorType.validateBlobContents(data))
3719
- vecOutData = "[]";
3720
- else {
3721
- let vecSize = VectorType.getVecSize(data);
3722
- let cellPicture = (cellAtt == StorageAttribute.NUMERIC || cellAtt == StorageAttribute.DATE || cellAtt == StorageAttribute.TIME) ? PIC.buildPicture(cellAtt, vector.getVecCell(1), task.getCompIdx(), true).getFormat() : picture;
3723
- vecOutData = "[";
3724
- for (let i = 0; i < vecSize; i++) {
3725
- vecOutData += this.getFieldData(cellAtt, vector.getVecCell(i + 1), cellPicture, vecCellType, task);
3726
- vecOutData += i < vecSize - 1 ? "," : "]";
3727
- }
3728
- }
3729
- }
3730
- data = vecOutData;
3731
- break;
3732
- case StorageAttribute.BOOLEAN:
3733
- data = data == "1" ? "TRUE" : "FALSE";
3734
- break;
3735
- }
3736
- return data;
3737
- }
3738
- PrepareDisplayString(mode, name, valueContent, addDoubleQuotes) {
3739
- let str = "";
3740
- let finalStringToDisplay = "";
3741
- if (addDoubleQuotes)
3742
- finalStringToDisplay = finalStringToDisplay + "\"";
3743
- finalStringToDisplay = finalStringToDisplay + name;
3744
- if (addDoubleQuotes)
3745
- finalStringToDisplay = finalStringToDisplay + "\"";
3746
- let paddedName = this.padRight(name, 34);
3747
- let formatOfStringVirtual = `Virtual`;
3748
- let formatOfStringParameter = `Parameter`;
3749
- str = (mode ? formatOfStringParameter : formatOfStringVirtual) + " : " + `${paddedName}` + " : " + `${valueContent}`;
3750
- return str;
3751
- }
3752
3647
  addTaskFlowRec(id, state, taskInfo) {
3753
3648
  if (this._enabled && this._isTaskFlow) {
3754
3649
  let info;
@@ -3913,7 +3808,6 @@ class FlowMonitorQueue {
3913
3808
  }
3914
3809
  }
3915
3810
  FlowMonitorQueue._instance = null;
3916
- FlowMonitorQueue.UNPRINTABLE_STR_LOG = "#UNPRINTABLE#";
3917
3811
  FlowMonitorQueue.S_EVENT_STR1 = ">>Starts ";
3918
3812
  FlowMonitorQueue.S_EVENT_STR2 = " Event";
3919
3813
  FlowMonitorQueue.S_EVENT_PROPAGATED = "Event was propagated";
@@ -5229,12 +5123,10 @@ class RemoteCommandsProcessor extends CommandsProcessorBase {
5229
5123
  async StoreSessionReInitializingDataOnLocalStorage() {
5230
5124
  let mainPrgViewStringForServer = await this.BuildXMLForMainProgramDataView();
5231
5125
  let globalParamsString = AccessHelper.globalParams.mirrorAllToXML();
5232
- let changedEnvVarList = AccessHelper.envParamsTable.mirrorAllToXML();
5233
5126
  let dataStorage = window.localStorage;
5234
5127
  dataStorage.setItem(ConstInterface.IS_SESSION_REINITIALIZING, "true");
5235
5128
  dataStorage.setItem(ConstInterface.MAIN_PROG_VIEW, mainPrgViewStringForServer.toString());
5236
5129
  dataStorage.setItem(ConstInterface.GLOBAL_PARAM_LIST, globalParamsString);
5237
- dataStorage.setItem(ConstInterface.ENV_VAR_LIST, changedEnvVarList);
5238
5130
  dataStorage.setItem(ConstInterface.LAST_EXCEPTION, RemoteCommandsProcessor.lastExceptionMessage);
5239
5131
  if (RuntimeContextBase.Instance.RemovedContextFromServer)
5240
5132
  dataStorage.setItem(ConstInterface.CTX_REMOVED_FROM_SRVR, "1");
@@ -5461,7 +5353,6 @@ class RemoteCommandsProcessor extends CommandsProcessorBase {
5461
5353
  let reqBuf;
5462
5354
  let isInitialCall = sessionStage === CommandsProcessorBase_SessionStage.INITIAL;
5463
5355
  let globalParamsString = null;
5464
- let envVarsString = null;
5465
5356
  if (this.DelayCommandExecution)
5466
5357
  return;
5467
5358
  if (Logger.Instance.LogLevel == Logger_LogLevels.RequestInfo && !isInitialCall)
@@ -5487,16 +5378,12 @@ class RemoteCommandsProcessor extends CommandsProcessorBase {
5487
5378
  let buffer = new StringBuilder();
5488
5379
  if (!RemoteCommandsProcessor.IsSessionReInitializing)
5489
5380
  buffer.Append(reqBuf);
5490
- if (RemoteCommandsProcessor.IsSessionReInitializing) {
5381
+ if (RemoteCommandsProcessor.IsSessionReInitializing)
5491
5382
  globalParamsString = this.RestoreSessionReInitializingDataFromLocalStorage(ConstInterface.GLOBAL_PARAM_LIST);
5492
- envVarsString = this.RestoreSessionReInitializingDataFromLocalStorage(ConstInterface.ENV_VAR_LIST);
5493
- }
5494
- else {
5383
+ else
5495
5384
  globalParamsString = AccessHelper.globalParams.mirrorToXML();
5496
- envVarsString = AccessHelper.envParamsTable.mirrorToXML();
5497
- }
5498
5385
  changes.Append(globalParamsString);
5499
- changes.Append(envVarsString);
5386
+ changes.Append(AccessHelper.envParamsTable.mirrorToXML());
5500
5387
  if (changes.Length > 0) {
5501
5388
  changes.Insert(0, "<" + ConstInterface.MG_TAG_ENV_CHANGES + ">");
5502
5389
  changes.Append("</" + ConstInterface.MG_TAG_ENV_CHANGES + ">");
@@ -5535,15 +5422,13 @@ class RemoteCommandsProcessor extends CommandsProcessorBase {
5535
5422
  dataStorage.removeItem(ConstInterface.IS_SESSION_REINITIALIZING);
5536
5423
  dataStorage.removeItem(ConstInterface.MAIN_PROG_VIEW);
5537
5424
  dataStorage.removeItem(ConstInterface.GLOBAL_PARAM_LIST);
5538
- dataStorage.removeItem(ConstInterface.ENV_VAR_LIST);
5539
5425
  dataStorage.removeItem(ConstInterface.LAST_EXCEPTION);
5540
5426
  }
5541
5427
  }
5542
5428
  FlowMonitorQueue.Instance.enable(false);
5543
5429
  await this.ProcessResponse(respBuf, AccessHelper.mgDataTable.currMgdID, null, res);
5544
5430
  if (RemoteCommandsProcessor.IsSessionReInitializing) {
5545
- AccessHelper.globalParams.RestoreParams(globalParamsString);
5546
- AccessHelper.envParamsTable.RestoreParams(envVarsString);
5431
+ AccessHelper.globalParams.RestoreGlobalParams(globalParamsString);
5547
5432
  let dataStorage = window.localStorage;
5548
5433
  let ctxRemoved = dataStorage.getItem(ConstInterface.CTX_REMOVED_FROM_SRVR);
5549
5434
  if (ctxRemoved === "1") {
@@ -7434,9 +7319,6 @@ class EventHandlerPosition {
7434
7319
  case InternalInterface.MG_ACT_REC_SUFFIX:
7435
7320
  case InternalInterface.MG_ACT_CTRL_PREFIX:
7436
7321
  case InternalInterface.MG_ACT_CTRL_SUFFIX: {
7437
- if (this._rtEvt.getInternalCode() == InternalInterface.MG_ACT_REC_PREFIX) {
7438
- FlowMonitorQueue.Instance.addDataViewFlow(this._task);
7439
- }
7440
7322
  if (this._handlerIdx === -1) {
7441
7323
  for (this._handlerIdx = this._handlersTab.getSize() - 1; this._handlerIdx >= 0; this._handlerIdx--) {
7442
7324
  let handler = this._handlersTab.getHandler(this._handlerIdx);
@@ -8359,7 +8241,7 @@ class MirrorPrmMap extends PrmMap {
8359
8241
  while (this.mirrorFromXML(parser.getNextTag(), parser)) {
8360
8242
  }
8361
8243
  }
8362
- RestoreParams(xml) {
8244
+ RestoreGlobalParams(xml) {
8363
8245
  let parser = new XmlParser(xml);
8364
8246
  while (this.mirrorFromXML(parser.getNextTag(), parser)) {
8365
8247
  }
@@ -8434,7 +8316,6 @@ class Environment {
8434
8316
  this._debugMode = 0;
8435
8317
  this._significantNumSize = 0;
8436
8318
  this._specialAnsiExpression = false;
8437
- this._specialImmediatehandlerEnd = false;
8438
8319
  this._specialShowStatusBarPanes = false;
8439
8320
  this._specialRouteToRootProgOnContextRecreation = false;
8440
8321
  this._specialCancelOnCreate = false;
@@ -8588,9 +8469,6 @@ class Environment {
8588
8469
  case ConstInterface.MG_ATTR_LOCAL_FLAGS:
8589
8470
  this._localFlags = valueStr;
8590
8471
  break;
8591
- case ConstInterface.MG_ATTR_SPECIAL_IMMEDIATE_HANDLER_END:
8592
- this._specialImmediatehandlerEnd = XmlParser.getBoolean(valueStr);
8593
- break;
8594
8472
  case ConstInterface.MG_ATTR_SPEACIAL_ANSI_EXP:
8595
8473
  this._specialAnsiExpression = XmlParser.getBoolean(valueStr);
8596
8474
  break;
@@ -8795,9 +8673,6 @@ class Environment {
8795
8673
  GetLocalFlag(f) {
8796
8674
  return this._localFlags !== null && this._localFlags.indexOf(f) >= 0;
8797
8675
  }
8798
- getSpecialImmediateHandlerEnd() {
8799
- return this._specialImmediatehandlerEnd;
8800
- }
8801
8676
  getSpecialAnsiExpression() {
8802
8677
  return this._specialAnsiExpression;
8803
8678
  }
@@ -9808,7 +9683,8 @@ class MirrorString {
9808
9683
  this._reserved = false;
9809
9684
  }
9810
9685
  mirrorToXML() {
9811
- return ConstInterface.MG_ATTR_ENV_VALUE + "=\"" + XmlParser.escape(this._value) + "\"";
9686
+ return ConstInterface.MG_ATTR_ENV_VALUE + "=\"" + XmlParser.escape(this._value) + "\" " +
9687
+ ConstInterface.MG_ATTR_ENV_WRITEINI + "=F";
9812
9688
  }
9813
9689
  init(name, xmlParser) {
9814
9690
  let valueStart, valueEnd, reserveStart, paramEnd;
@@ -19362,7 +19238,11 @@ class MgForm extends MgFormBase {
19362
19238
  this.GetDataview().setTopRecIdxModified(true);
19363
19239
  try {
19364
19240
  this._suffixDone = false;
19365
- await this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx() + size, true, false);
19241
+ let newDisplayLine = this.GetDataview().getCurrRecIdx() + size;
19242
+ if (unit === Constants.MOVE_UNIT_PAGE && this.isLineMode())
19243
+ if (newDisplayLine > this.GetDataview().getSize() - 1)
19244
+ visibleLine -= newDisplayLine - (this.GetDataview().getSize() - 1);
19245
+ await this.setCurrRowByDisplayLine(newDisplayLine, true, false);
19366
19246
  this.GetDataview().setTopRecIdxModified(false);
19367
19247
  await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
19368
19248
  }
@@ -19402,7 +19282,6 @@ class MgForm extends MgFormBase {
19402
19282
  try {
19403
19283
  await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
19404
19284
  await this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx() + this.getLastValidRow(), false, true);
19405
- visibleLine = this.getLastValidRow();
19406
19285
  }
19407
19286
  catch (Exception) {
19408
19287
  }
@@ -21475,10 +21354,8 @@ class EventHandler {
21475
21354
  continue;
21476
21355
  else if (this._operationTab.getOperation(oper.getBlockEnd()).getServerId() < nextOperIdx)
21477
21356
  continue;
21478
- if (!taskEnd) {
21479
- if (await this._task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE) && Environment.Instance.getSpecialImmediateHandlerEnd())
21480
- break;
21481
- }
21357
+ if (!taskEnd)
21358
+ await this._task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE);
21482
21359
  if (this._taskMgdID !== mgdID)
21483
21360
  isChangedCurrWndRef.value = true;
21484
21361
  if (!this._task.isMainProg() && this._task.isOpenWin())
@@ -29533,7 +29410,7 @@ class CommandsTable {
29533
29410
  }
29534
29411
  }
29535
29412
 
29536
- let CurrentClientVersion = '4.1000.0-dev4100.108';
29413
+ let CurrentClientVersion = '4.1000.0-dev4100.109';
29537
29414
 
29538
29415
  class ClientManager {
29539
29416
  constructor() {