Beispiel #1
0
        public override async Task GetInfoAsync(GeMenuItemInput geMenuItemInput)
        {
            var itemDataModel  = geMenuItemInput.ItemDataModel;
            var moduleId       = itemDataModel.Id;
            var currentRequest = geMenuItemInput.CurrentRequest;
            var propertyName   = itemDataModel.PropertyName;

            var isPrivate = NewsItemBusinessModule.IsPrivate(propertyName);

            if (isPrivate && geMenuItemInput.IsSitemap)
            {
                return;
            }

            var menuItem = await NewsItemBusinessModule.GetMenuItemAsync(_urlProvider, itemDataModel, currentRequest, ModuleName, isPrivate);

            if (menuItem != null)
            {
                var expendoMenu = CacheProvider.ToExpando(menuItem);
                {
                    var items =
                        await
                        geMenuItemInput.DataFactory.ItemRepository.GetItemsAsync(itemDataModel.SiteId,
                                                                                 new ItemFilters { ParentId = moduleId });

                    await
                    CacheProvider.GetChildsAsync(_businessModuleFactory, geMenuItemInput.CurrentRequest, items,
                                                 expendoMenu,
                                                 geMenuItemInput.DataFactory);
                }

                ModuleManager.Add(geMenuItemInput.Master, itemDataModel.PropertyName, expendoMenu,
                                  itemDataModel.PropertyType);
            }
        }