From 06550fa5853e6b8abba532e20057abfbf7b7dc28 Mon Sep 17 00:00:00 2001 From: Caleb Blanchard Date: Thu, 1 Feb 2024 13:03:50 -0500 Subject: [PATCH] Add label fields to menu item cross reference table/form (#32) Co-authored-by: Caleb Blanchard --- .../AxClass/ARBMenuItemRefPopulateService.xml | 50 +++++++++++++++++++ .../AxForm/ARBMenuItemReferences.xml | 24 +++++++++ .../en-US/AOTBrowser.en-US.label.txt | 2 + .../AxTable/ARBMenuItemReferences.xml | 12 +++++ 4 files changed, 88 insertions(+) diff --git a/Metadata/AOTBrowser/AOTBrowser/AxClass/ARBMenuItemRefPopulateService.xml b/Metadata/AOTBrowser/AOTBrowser/AxClass/ARBMenuItemRefPopulateService.xml index f7c6a46..85f5e6e 100644 --- a/Metadata/AOTBrowser/AOTBrowser/AxClass/ARBMenuItemRefPopulateService.xml +++ b/Metadata/AOTBrowser/AOTBrowser/AxClass/ARBMenuItemRefPopulateService.xml @@ -17,6 +17,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase ARBMenuItemReferences menuItemRefs; RecordInsertList menuItemRefsInsertList = new RecordInsertList(tableNum(ARBMenuItemReferences)); str currentObjectName; + str currentObjectLabel; ARBAOTObjectType currentObjectType; } @@ -78,6 +79,24 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase menuItemRefsInsertList.insertDatabase(); } +]]> + + + getLabelForObject + @@ -91,6 +110,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase { AxWorkflowTemplate workflowType = Xpp.MetadataSupport::GetWorkflowTemplate(workflowTypesEnum.Current); currentObjectName = workflowType.Name; + currentObjectLabel = this.getLabelForObject(workflowType); this.processWorkflowType(workflowType, ''); } @@ -147,6 +167,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase { AxKPI kpi = Xpp.MetadataSupport::GetKPI(kpisEnum.Current); currentObjectName = kpi.Name; + currentObjectLabel = this.getLabelForObject(kpi); this.processKPI(kpi, ''); } @@ -188,6 +209,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase { AxMap map = Xpp.MetadataSupport::GetMap(mapsEnum.Current); currentObjectName = map.Name; + currentObjectLabel = this.getLabelForObject(map); this.processMap(map, ''); } @@ -219,6 +241,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase { AxCompositeDataEntityView compositeDataEntity = ArbelaXpp.MetadataSupport::GetCompositeDataEntity(compositeEntitiesEnum.Current); currentObjectName = compositeDataEntity.Name; + currentObjectLabel = this.getLabelForObject(compositeDataEntity); this.processCompositeDataEntity(compositeDataEntity, ''); } @@ -250,6 +273,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase { AxView view = Xpp.MetadataSupport::GetView(viewsEnum.Current); currentObjectName = view.Name; + currentObjectLabel = this.getLabelForObject(view); this.processView(view, ''); } @@ -281,6 +305,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase { AxDataEntityView dataEntity = Xpp.MetadataSupport::GetDataEntityView(dataEntitiesEnum.Current); currentObjectName = dataEntity.Name; + currentObjectLabel = this.getLabelForObject(dataEntity); this.processDataEntityView(dataEntity, ''); } @@ -312,6 +337,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase { AxTable table = Xpp.MetadataSupport::GetTable(tablesEnum.Current); currentObjectName = table.Name; + currentObjectLabel = this.getLabelForObject(table); this.processTable(table, ''); } @@ -358,6 +384,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase { AxWorkflowTask workflowTask = Xpp.MetadataSupport::GetWorkflowTask(workflowTasksEnum.Current); currentObjectName = workflowTask.Name; + currentObjectLabel = this.getLabelForObject(workflowTask); this.processWorkflowTask(workflowTask, ''); } @@ -410,6 +437,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase { AxSecurityPrivilege securityPrivilege = ArbelaXpp.MetadataSupport::GetSecurityPrivilege(securityPrivilegesEnum.Current); currentObjectName = securityPrivilege.Name; + currentObjectLabel = this.getLabelForObject(securityPrivilege); this.processSecurityPrivilege(securityPrivilege, ''); } @@ -461,6 +489,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase { AxWorkflowApproval workflowApproval = Xpp.MetadataSupport::GetWorkflowApproval(workflowApprovalsEnum.Current); currentObjectName = workflowApproval.Name; + currentObjectLabel = this.getLabelForObject(workflowApproval); this.processWorkflowApproval(workflowApproval, ''); } @@ -520,7 +549,25 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase ARBMenuItemReferences menuItemReference; menuItemReference.MenuItemName = _menuItemName; menuItemReference.MenuItemType = _menuItemType; + AxMenuItem menuItem; + switch (_menuItemType) + { + case MenuItemType::Action: + menuItem = Xpp.MetadataSupport::GetMenuItemAction(_menuItemName); + break; + case MenuItemType::Display: + menuItem = Xpp.MetadataSupport::GetMenuItemDisplay(_menuItemName); + break; + case MenuItemType::Output: + menuItem = Xpp.MetadataSupport::GetMenuItemOutput(_menuItemName); + break; + } + if (!CLRInterop::isNull(menuItem)) + { + menuItemReference.MenuItemLabel = SysLabel::labelId2String(menuItem.Label); + } menuItemReference.RefObjectName = currentObjectName; + menuItemReference.RefObjectLabel = currentObjectLabel; menuItemReference.RefObjectType = currentObjectType; menuItemReference.RefPath = _path; menuItemRefsInsertList.add(menuItemReference); @@ -539,6 +586,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase { AxTile tile = Xpp.MetadataSupport::GetTile(tileNamesEnum.Current); currentObjectName = tile.Name; + currentObjectLabel = this.getLabelForObject(tile); this.processTile(tile, ''); } @@ -570,6 +618,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase { AxMenu menu = Xpp.MetadataSupport::GetMenu(menuNamesEnum.Current); currentObjectName = menu.Name; + currentObjectLabel = this.getLabelForObject(menu); var menuElementsEnum = menu.Elements.GetEnumerator(); while (menuElementsEnum.MoveNext()) @@ -635,6 +684,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase //AxForm form = Xpp.MetadataSupport::GetForm(formNamesEnum.Current); AxForm form = metadataProvider.Forms.Read(formNamesEnum.Current); currentObjectName = form.Name; + currentObjectLabel = this.getLabelForObject(form); var formControls = form.Design.Controls; var controlsEnum = formControls.GetEnumerator(); diff --git a/Metadata/AOTBrowser/AOTBrowser/AxForm/ARBMenuItemReferences.xml b/Metadata/AOTBrowser/AOTBrowser/AxForm/ARBMenuItemReferences.xml index 448c47f..f368a09 100644 --- a/Metadata/AOTBrowser/AOTBrowser/AxForm/ARBMenuItemReferences.xml +++ b/Metadata/AOTBrowser/AOTBrowser/AxForm/ARBMenuItemReferences.xml @@ -68,6 +68,9 @@ public class ARBMenuItemReferences extends FormRun ARBMenuItemReferences ARBMenuItemReferences
+ + MenuItemLabel + MenuItemName @@ -80,6 +83,9 @@ public class ARBMenuItemReferences extends FormRun RecId + + RefObjectLabel + RefObjectName @@ -201,6 +207,15 @@ public class ARBMenuItemReferences extends FormRun MenuItemName ARBMenuItemReferences + + ARBMenuItemReferences_MenuItemLabel + String + + MenuItemLabel + ARBMenuItemReferences + ARBMenuItemReferences_MenuItemType @@ -220,6 +235,15 @@ public class ARBMenuItemReferences extends FormRun RefObjectName ARBMenuItemReferences + + ARBMenuItemReferences_RefObjectLabel + String + + RefObjectLabel + ARBMenuItemReferences + ARBMenuItemReferences_RefObjectType diff --git a/Metadata/AOTBrowser/AOTBrowser/AxLabelFile/LabelResources/en-US/AOTBrowser.en-US.label.txt b/Metadata/AOTBrowser/AOTBrowser/AxLabelFile/LabelResources/en-US/AOTBrowser.en-US.label.txt index 11d2c74..3fad37f 100644 --- a/Metadata/AOTBrowser/AOTBrowser/AxLabelFile/LabelResources/en-US/AOTBrowser.en-US.label.txt +++ b/Metadata/AOTBrowser/AOTBrowser/AxLabelFile/LabelResources/en-US/AOTBrowser.en-US.label.txt @@ -38,6 +38,7 @@ MenuItemAction=Action menu item ;ARB_AOTBrowser MenuItemDisplay=Display menu item ;ARB_AOTBrowser +MenuItemLabel=Menu item label MenuItemOutput=Output menu item ;ARB_AOTBrowser MenuItemReferences=Menu item references @@ -69,6 +70,7 @@ Reference=Reference ReferenceObjectName=Reference object name ReferenceObjectType=Reference object type ReferencePath=Reference path +RefObjectLabel=Reference object label Report=Report ;ARB_AOTBrowser Resource=Resource diff --git a/Metadata/AOTBrowser/AOTBrowser/AxTable/ARBMenuItemReferences.xml b/Metadata/AOTBrowser/AOTBrowser/AxTable/ARBMenuItemReferences.xml index b025bd2..591240e 100644 --- a/Metadata/AOTBrowser/AOTBrowser/AxTable/ARBMenuItemReferences.xml +++ b/Metadata/AOTBrowser/AOTBrowser/AxTable/ARBMenuItemReferences.xml @@ -74,6 +74,18 @@ public class ARBMenuItemReferences extends common RefPath ARBMenuItemReferencePath + + RefObjectLabel + Description + + + + MenuItemLabel + Description + +