Search in sources :

Example 6 with ModuleMenuLink

use of org.motechproject.server.web.dto.ModuleMenuLink in project motech by motech.

the class MenuBuilder method serverModulesMenuSection.

private ModuleMenuSection serverModulesMenuSection(List<String> userRoles) {
    ModuleMenuSection modulesSection = new ModuleMenuSection("server.modules", false);
    for (ModuleRegistrationData moduleRegistrationData : getModulesWithoutSubMenu(userRoles)) {
        String name = moduleRegistrationData.getModuleName();
        String angularName = getAngularModuleName(moduleRegistrationData);
        boolean needsAttention = moduleRegistrationData.isNeedsAttention();
        // these menu items don't make use of urls, the name is sufficient
        ModuleMenuLink link = new ModuleMenuLink(name, angularName, determineDefaultTab(moduleRegistrationData), needsAttention, moduleRegistrationData.getDocumentationUrl());
        modulesSection.addLink(link);
    }
    return modulesSection;
}
Also used : ModuleMenuLink(org.motechproject.server.web.dto.ModuleMenuLink) ModuleMenuSection(org.motechproject.server.web.dto.ModuleMenuSection) ModuleRegistrationData(org.motechproject.osgi.web.ModuleRegistrationData)

Aggregations

ModuleMenuLink (org.motechproject.server.web.dto.ModuleMenuLink)6 ModuleMenuSection (org.motechproject.server.web.dto.ModuleMenuSection)3 Map (java.util.Map)1 Test (org.junit.Test)1 ModuleRegistrationData (org.motechproject.osgi.web.ModuleRegistrationData)1 SubmenuInfo (org.motechproject.osgi.web.SubmenuInfo)1 ModuleMenu (org.motechproject.server.web.dto.ModuleMenu)1 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)1