
org.giavacms.exhibition.module.ExhibitionMenuProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of exhibition Show documentation
Show all versions of exhibition Show documentation
GiavaCMS Content Management System: Exhibition Module
The newest version!
package org.giavacms.exhibition.module;
import java.util.ArrayList;
import java.util.List;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.inject.Named;
import org.giavacms.base.common.module.MenuProvider;
import org.giavacms.base.common.module.MenuValue;
import org.giavacms.exhibition.model.Exhibition;
import org.giavacms.exhibition.repository.ExhibitionRepository;
@Named
@ApplicationScoped
public class ExhibitionMenuProvider implements MenuProvider {
@Inject
ExhibitionRepository exhibitionRepository;
@Override
public List getMenuItemSources() {
List list = new ArrayList();
list.add("esibizioni");
return list;
}
@Override
public List getMenuItemValues(String name) {
if (name.compareTo("esibizioni") == 0) {
List list = exhibitionRepository.getAllList();
List menuList = new ArrayList();
if (list != null && list.size() > 0)
for (Exhibition exhibition : list) {
menuList.add(new MenuValue(exhibition.getName(), ""
+ exhibition.getId()));
}
return menuList;
}
return null;
}
@Override
public String getName() {
return "esibizioni";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy