@@ -17,6 +17,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
1717 ARBMenuItemReferences menuItemRefs;
1818 RecordInsertList menuItemRefsInsertList = new RecordInsertList(tableNum(ARBMenuItemReferences));
1919 str currentObjectName;
20+ str currentObjectLabel;
2021 ARBAOTObjectType currentObjectType;
2122
2223}
@@ -78,6 +79,24 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
7879 menuItemRefsInsertList.insertDatabase();
7980 }
8081
82+ ]]> </Source >
83+ </Method >
84+ <Method >
85+ <Name >getLabelForObject</Name >
86+ <Source ><![CDATA[
87+ protected str getLabelForObject(anytype _object)
88+ {
89+ System.Type objectType = _object.GetType();
90+ PropertyInfo labelProp = objectType.GetProperty('Label');
91+
92+ if (labelProp)
93+ {
94+ return SysLabel::labelId2String(labelProp.GetValue(_object).ToString());
95+ }
96+
97+ return '';
98+ }
99+
81100]]> </Source >
82101 </Method >
83102 <Method >
@@ -91,6 +110,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
91110 {
92111 AxWorkflowTemplate workflowType = Xpp.MetadataSupport::GetWorkflowTemplate(workflowTypesEnum.Current);
93112 currentObjectName = workflowType.Name;
113+ currentObjectLabel = this.getLabelForObject(workflowType);
94114
95115 this.processWorkflowType(workflowType, '');
96116 }
@@ -147,6 +167,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
147167 {
148168 AxKPI kpi = Xpp.MetadataSupport::GetKPI(kpisEnum.Current);
149169 currentObjectName = kpi.Name;
170+ currentObjectLabel = this.getLabelForObject(kpi);
150171
151172 this.processKPI(kpi, '');
152173 }
@@ -188,6 +209,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
188209 {
189210 AxMap map = Xpp.MetadataSupport::GetMap(mapsEnum.Current);
190211 currentObjectName = map.Name;
212+ currentObjectLabel = this.getLabelForObject(map);
191213
192214 this.processMap(map, '');
193215 }
@@ -219,6 +241,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
219241 {
220242 AxCompositeDataEntityView compositeDataEntity = ArbelaXpp.MetadataSupport::GetCompositeDataEntity(compositeEntitiesEnum.Current);
221243 currentObjectName = compositeDataEntity.Name;
244+ currentObjectLabel = this.getLabelForObject(compositeDataEntity);
222245
223246 this.processCompositeDataEntity(compositeDataEntity, '');
224247 }
@@ -250,6 +273,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
250273 {
251274 AxView view = Xpp.MetadataSupport::GetView(viewsEnum.Current);
252275 currentObjectName = view.Name;
276+ currentObjectLabel = this.getLabelForObject(view);
253277
254278 this.processView(view, '');
255279 }
@@ -281,6 +305,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
281305 {
282306 AxDataEntityView dataEntity = Xpp.MetadataSupport::GetDataEntityView(dataEntitiesEnum.Current);
283307 currentObjectName = dataEntity.Name;
308+ currentObjectLabel = this.getLabelForObject(dataEntity);
284309
285310 this.processDataEntityView(dataEntity, '');
286311 }
@@ -312,6 +337,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
312337 {
313338 AxTable table = Xpp.MetadataSupport::GetTable(tablesEnum.Current);
314339 currentObjectName = table.Name;
340+ currentObjectLabel = this.getLabelForObject(table);
315341
316342 this.processTable(table, '');
317343 }
@@ -358,6 +384,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
358384 {
359385 AxWorkflowTask workflowTask = Xpp.MetadataSupport::GetWorkflowTask(workflowTasksEnum.Current);
360386 currentObjectName = workflowTask.Name;
387+ currentObjectLabel = this.getLabelForObject(workflowTask);
361388
362389 this.processWorkflowTask(workflowTask, '');
363390 }
@@ -410,6 +437,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
410437 {
411438 AxSecurityPrivilege securityPrivilege = ArbelaXpp.MetadataSupport::GetSecurityPrivilege(securityPrivilegesEnum.Current);
412439 currentObjectName = securityPrivilege.Name;
440+ currentObjectLabel = this.getLabelForObject(securityPrivilege);
413441
414442 this.processSecurityPrivilege(securityPrivilege, '');
415443 }
@@ -461,6 +489,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
461489 {
462490 AxWorkflowApproval workflowApproval = Xpp.MetadataSupport::GetWorkflowApproval(workflowApprovalsEnum.Current);
463491 currentObjectName = workflowApproval.Name;
492+ currentObjectLabel = this.getLabelForObject(workflowApproval);
464493
465494 this.processWorkflowApproval(workflowApproval, '');
466495 }
@@ -520,7 +549,25 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
520549 ARBMenuItemReferences menuItemReference;
521550 menuItemReference.MenuItemName = _menuItemName;
522551 menuItemReference.MenuItemType = _menuItemType;
552+ AxMenuItem menuItem;
553+ switch (_menuItemType)
554+ {
555+ case MenuItemType::Action:
556+ menuItem = Xpp.MetadataSupport::GetMenuItemAction(_menuItemName);
557+ break;
558+ case MenuItemType::Display:
559+ menuItem = Xpp.MetadataSupport::GetMenuItemDisplay(_menuItemName);
560+ break;
561+ case MenuItemType::Output:
562+ menuItem = Xpp.MetadataSupport::GetMenuItemOutput(_menuItemName);
563+ break;
564+ }
565+ if (!CLRInterop::isNull(menuItem))
566+ {
567+ menuItemReference.MenuItemLabel = SysLabel::labelId2String(menuItem.Label);
568+ }
523569 menuItemReference.RefObjectName = currentObjectName;
570+ menuItemReference.RefObjectLabel = currentObjectLabel;
524571 menuItemReference.RefObjectType = currentObjectType;
525572 menuItemReference.RefPath = _path;
526573 menuItemRefsInsertList.add(menuItemReference);
@@ -539,6 +586,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
539586 {
540587 AxTile tile = Xpp.MetadataSupport::GetTile(tileNamesEnum.Current);
541588 currentObjectName = tile.Name;
589+ currentObjectLabel = this.getLabelForObject(tile);
542590
543591 this.processTile(tile, '');
544592 }
@@ -570,6 +618,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
570618 {
571619 AxMenu menu = Xpp.MetadataSupport::GetMenu(menuNamesEnum.Current);
572620 currentObjectName = menu.Name;
621+ currentObjectLabel = this.getLabelForObject(menu);
573622
574623 var menuElementsEnum = menu.Elements.GetEnumerator();
575624 while (menuElementsEnum.MoveNext())
@@ -635,6 +684,7 @@ class ARBMenuItemRefPopulateService extends SysOperationServiceBase
635684 //AxForm form = Xpp.MetadataSupport::GetForm(formNamesEnum.Current);
636685 AxForm form = metadataProvider.Forms.Read(formNamesEnum.Current);
637686 currentObjectName = form.Name;
687+ currentObjectLabel = this.getLabelForObject(form);
638688
639689 var formControls = form.Design.Controls;
640690 var controlsEnum = formControls.GetEnumerator();
0 commit comments