@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,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,92 +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
- let contentType = BlobType.getContentType(data);
3694
- if (contentType == BlobType.CONTENT_TYPE_ANSI || contentType == BlobType.CONTENT_TYPE_UNICODE)
3695
- data = data != null ? BlobType.getString(data) : "";
3696
- else
3697
- data = FlowMonitorQueue.UNPRINTABLE_STR_LOG;
3698
- }
3699
- break;
3700
- case StorageAttribute.NUMERIC:
3701
- case StorageAttribute.DATE:
3702
- case StorageAttribute.TIME:
3703
- let conv = DisplayConvertor.Instance;
3704
- data = conv.mg2disp(data, " ", new PIC(picture, Storagetype, task.getCompIdx()), false, task.getCompIdx(), false);
3705
- break;
3706
- case StorageAttribute.BLOB_VECTOR:
3707
- let vecOutData;
3708
- if (data == null) {
3709
- vecOutData = "[]";
3710
- }
3711
- else {
3712
- let cellAtt = vecCellType;
3713
- let vector = new VectorType(data);
3714
- if (cellAtt == StorageAttribute.BLOB && !VectorType.validateBlobContents(data))
3715
- vecOutData = "[]";
3716
- else {
3717
- let vecSize = VectorType.getVecSize(data);
3718
- let cellPicture = (cellAtt == StorageAttribute.NUMERIC || cellAtt == StorageAttribute.DATE || cellAtt == StorageAttribute.TIME) ? PIC.buildPicture(cellAtt, vector.getVecCell(1), task.getCompIdx(), true).getFormat() : picture;
3719
- vecOutData = "[";
3720
- for (let i = 0; i < vecSize; i++) {
3721
- vecOutData += this.getFieldData(cellAtt, vector.getVecCell(i + 1), cellPicture, vecCellType, task);
3722
- vecOutData += i < vecSize - 1 ? "," : "]";
3723
- }
3724
- }
3725
- }
3726
- data = vecOutData;
3727
- break;
3728
- case StorageAttribute.BOOLEAN:
3729
- data = data == "1" ? "TRUE" : "FALSE";
3730
- break;
3731
- }
3732
- return data;
3733
- }
3734
- PrepareDisplayString(mode, name, valueContent, addDoubleQuotes) {
3735
- let str = "";
3736
- let finalStringToDisplay = "";
3737
- if (addDoubleQuotes)
3738
- finalStringToDisplay = finalStringToDisplay + "\"";
3739
- finalStringToDisplay = finalStringToDisplay + name;
3740
- if (addDoubleQuotes)
3741
- finalStringToDisplay = finalStringToDisplay + "\"";
3742
- let paddedName = this.padRight(name, 34);
3743
- let formatOfStringVirtual = `Virtual`;
3744
- let formatOfStringParameter = `Parameter`;
3745
- str = (mode ? formatOfStringParameter : formatOfStringVirtual) + " : " + `${paddedName}` + " : " + `${valueContent}`;
3746
- return str;
3747
- }
3748
3647
  addTaskFlowRec(id, state, taskInfo) {
3749
3648
  if (this._enabled && this._isTaskFlow) {
3750
3649
  let info;
@@ -3909,7 +3808,6 @@ class FlowMonitorQueue {
3909
3808
  }
3910
3809
  }
3911
3810
  FlowMonitorQueue._instance = null;
3912
- FlowMonitorQueue.UNPRINTABLE_STR_LOG = "#UNPRINTABLE#";
3913
3811
  FlowMonitorQueue.S_EVENT_STR1 = ">>Starts ";
3914
3812
  FlowMonitorQueue.S_EVENT_STR2 = " Event";
3915
3813
  FlowMonitorQueue.S_EVENT_PROPAGATED = "Event was propagated";
@@ -5225,12 +5123,10 @@ class RemoteCommandsProcessor extends CommandsProcessorBase {
5225
5123
  async StoreSessionReInitializingDataOnLocalStorage() {
5226
5124
  let mainPrgViewStringForServer = await this.BuildXMLForMainProgramDataView();
5227
5125
  let globalParamsString = AccessHelper.globalParams.mirrorAllToXML();
5228
- let changedEnvVarList = AccessHelper.envParamsTable.mirrorAllToXML();
5229
5126
  let dataStorage = window.localStorage;
5230
5127
  dataStorage.setItem(ConstInterface.IS_SESSION_REINITIALIZING, "true");
5231
5128
  dataStorage.setItem(ConstInterface.MAIN_PROG_VIEW, mainPrgViewStringForServer.toString());
5232
5129
  dataStorage.setItem(ConstInterface.GLOBAL_PARAM_LIST, globalParamsString);
5233
- dataStorage.setItem(ConstInterface.ENV_VAR_LIST, changedEnvVarList);
5234
5130
  dataStorage.setItem(ConstInterface.LAST_EXCEPTION, RemoteCommandsProcessor.lastExceptionMessage);
5235
5131
  if (RuntimeContextBase.Instance.RemovedContextFromServer)
5236
5132
  dataStorage.setItem(ConstInterface.CTX_REMOVED_FROM_SRVR, "1");
@@ -5457,7 +5353,6 @@ class RemoteCommandsProcessor extends CommandsProcessorBase {
5457
5353
  let reqBuf;
5458
5354
  let isInitialCall = sessionStage === CommandsProcessorBase_SessionStage.INITIAL;
5459
5355
  let globalParamsString = null;
5460
- let envVarsString = null;
5461
5356
  if (this.DelayCommandExecution)
5462
5357
  return;
5463
5358
  if (Logger.Instance.LogLevel == Logger_LogLevels.RequestInfo && !isInitialCall)
@@ -5483,16 +5378,12 @@ class RemoteCommandsProcessor extends CommandsProcessorBase {
5483
5378
  let buffer = new StringBuilder();
5484
5379
  if (!RemoteCommandsProcessor.IsSessionReInitializing)
5485
5380
  buffer.Append(reqBuf);
5486
- if (RemoteCommandsProcessor.IsSessionReInitializing) {
5381
+ if (RemoteCommandsProcessor.IsSessionReInitializing)
5487
5382
  globalParamsString = this.RestoreSessionReInitializingDataFromLocalStorage(ConstInterface.GLOBAL_PARAM_LIST);
5488
- envVarsString = this.RestoreSessionReInitializingDataFromLocalStorage(ConstInterface.ENV_VAR_LIST);
5489
- }
5490
- else {
5383
+ else
5491
5384
  globalParamsString = AccessHelper.globalParams.mirrorToXML();
5492
- envVarsString = AccessHelper.envParamsTable.mirrorToXML();
5493
- }
5494
5385
  changes.Append(globalParamsString);
5495
- changes.Append(envVarsString);
5386
+ changes.Append(AccessHelper.envParamsTable.mirrorToXML());
5496
5387
  if (changes.Length > 0) {
5497
5388
  changes.Insert(0, "<" + ConstInterface.MG_TAG_ENV_CHANGES + ">");
5498
5389
  changes.Append("</" + ConstInterface.MG_TAG_ENV_CHANGES + ">");
@@ -5531,15 +5422,13 @@ class RemoteCommandsProcessor extends CommandsProcessorBase {
5531
5422
  dataStorage.removeItem(ConstInterface.IS_SESSION_REINITIALIZING);
5532
5423
  dataStorage.removeItem(ConstInterface.MAIN_PROG_VIEW);
5533
5424
  dataStorage.removeItem(ConstInterface.GLOBAL_PARAM_LIST);
5534
- dataStorage.removeItem(ConstInterface.ENV_VAR_LIST);
5535
5425
  dataStorage.removeItem(ConstInterface.LAST_EXCEPTION);
5536
5426
  }
5537
5427
  }
5538
5428
  FlowMonitorQueue.Instance.enable(false);
5539
5429
  await this.ProcessResponse(respBuf, AccessHelper.mgDataTable.currMgdID, null, res);
5540
5430
  if (RemoteCommandsProcessor.IsSessionReInitializing) {
5541
- AccessHelper.globalParams.RestoreParams(globalParamsString);
5542
- AccessHelper.envParamsTable.RestoreParams(envVarsString);
5431
+ AccessHelper.globalParams.RestoreGlobalParams(globalParamsString);
5543
5432
  let dataStorage = window.localStorage;
5544
5433
  let ctxRemoved = dataStorage.getItem(ConstInterface.CTX_REMOVED_FROM_SRVR);
5545
5434
  if (ctxRemoved === "1") {
@@ -7430,9 +7319,6 @@ class EventHandlerPosition {
7430
7319
  case InternalInterface.MG_ACT_REC_SUFFIX:
7431
7320
  case InternalInterface.MG_ACT_CTRL_PREFIX:
7432
7321
  case InternalInterface.MG_ACT_CTRL_SUFFIX: {
7433
- if (this._rtEvt.getInternalCode() == InternalInterface.MG_ACT_REC_PREFIX) {
7434
- FlowMonitorQueue.Instance.addDataViewFlow(this._task);
7435
- }
7436
7322
  if (this._handlerIdx === -1) {
7437
7323
  for (this._handlerIdx = this._handlersTab.getSize() - 1; this._handlerIdx >= 0; this._handlerIdx--) {
7438
7324
  let handler = this._handlersTab.getHandler(this._handlerIdx);
@@ -8355,7 +8241,7 @@ class MirrorPrmMap extends PrmMap {
8355
8241
  while (this.mirrorFromXML(parser.getNextTag(), parser)) {
8356
8242
  }
8357
8243
  }
8358
- RestoreParams(xml) {
8244
+ RestoreGlobalParams(xml) {
8359
8245
  let parser = new XmlParser(xml);
8360
8246
  while (this.mirrorFromXML(parser.getNextTag(), parser)) {
8361
8247
  }
@@ -8430,7 +8316,6 @@ class Environment {
8430
8316
  this._debugMode = 0;
8431
8317
  this._significantNumSize = 0;
8432
8318
  this._specialAnsiExpression = false;
8433
- this._specialImmediatehandlerEnd = false;
8434
8319
  this._specialShowStatusBarPanes = false;
8435
8320
  this._specialRouteToRootProgOnContextRecreation = false;
8436
8321
  this._specialCancelOnCreate = false;
@@ -8584,9 +8469,6 @@ class Environment {
8584
8469
  case ConstInterface.MG_ATTR_LOCAL_FLAGS:
8585
8470
  this._localFlags = valueStr;
8586
8471
  break;
8587
- case ConstInterface.MG_ATTR_SPECIAL_IMMEDIATE_HANDLER_END:
8588
- this._specialImmediatehandlerEnd = XmlParser.getBoolean(valueStr);
8589
- break;
8590
8472
  case ConstInterface.MG_ATTR_SPEACIAL_ANSI_EXP:
8591
8473
  this._specialAnsiExpression = XmlParser.getBoolean(valueStr);
8592
8474
  break;
@@ -8791,9 +8673,6 @@ class Environment {
8791
8673
  GetLocalFlag(f) {
8792
8674
  return this._localFlags !== null && this._localFlags.indexOf(f) >= 0;
8793
8675
  }
8794
- getSpecialImmediateHandlerEnd() {
8795
- return this._specialImmediatehandlerEnd;
8796
- }
8797
8676
  getSpecialAnsiExpression() {
8798
8677
  return this._specialAnsiExpression;
8799
8678
  }
@@ -9804,7 +9683,8 @@ class MirrorString {
9804
9683
  this._reserved = false;
9805
9684
  }
9806
9685
  mirrorToXML() {
9807
- 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";
9808
9688
  }
9809
9689
  init(name, xmlParser) {
9810
9690
  let valueStart, valueEnd, reserveStart, paramEnd;
@@ -19358,7 +19238,11 @@ class MgForm extends MgFormBase {
19358
19238
  this.GetDataview().setTopRecIdxModified(true);
19359
19239
  try {
19360
19240
  this._suffixDone = false;
19361
- 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);
19362
19246
  this.GetDataview().setTopRecIdxModified(false);
19363
19247
  await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
19364
19248
  }
@@ -19398,7 +19282,6 @@ class MgForm extends MgFormBase {
19398
19282
  try {
19399
19283
  await this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
19400
19284
  await this.setCurrRowByDisplayLine(this.GetDataview().getTopRecIdx() + this.getLastValidRow(), false, true);
19401
- visibleLine = this.getLastValidRow();
19402
19285
  }
19403
19286
  catch (Exception) {
19404
19287
  }
@@ -21471,10 +21354,8 @@ class EventHandler {
21471
21354
  continue;
21472
21355
  else if (this._operationTab.getOperation(oper.getBlockEnd()).getServerId() < nextOperIdx)
21473
21356
  continue;
21474
- if (!taskEnd) {
21475
- if (await this._task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE) && Environment.Instance.getSpecialImmediateHandlerEnd())
21476
- break;
21477
- }
21357
+ if (!taskEnd)
21358
+ await this._task.evalEndCond(ConstInterface.END_COND_EVAL_IMMIDIATE);
21478
21359
  if (this._taskMgdID !== mgdID)
21479
21360
  isChangedCurrWndRef.value = true;
21480
21361
  if (!this._task.isMainProg() && this._task.isOpenWin())
@@ -29529,7 +29410,7 @@ class CommandsTable {
29529
29410
  }
29530
29411
  }
29531
29412
 
29532
- let CurrentClientVersion = '4.1000.0-dev4100.107';
29413
+ let CurrentClientVersion = '4.1000.0-dev4100.109';
29533
29414
 
29534
29415
  class ClientManager {
29535
29416
  constructor() {