Search in sources :

Example 1 with IMenuObjectFilter

use of com.helger.photon.core.menu.IMenuObjectFilter in project phoss-smp by phax.

the class MenuSecure method init.

public static void init(@Nonnull final IMenuTree aMenuTree) {
    final MenuObjectFilterUserAssignedToUserGroup aFilterAdministrators = new MenuObjectFilterUserAssignedToUserGroup(CSMP.USERGROUP_ADMINISTRATORS_ID);
    final IMenuObjectFilter aFilterPeppolDirectory = x -> SMPMetaManager.getSettings().isDirectoryIntegrationEnabled() && SMPMetaManager.hasBusinessCardMgr();
    final IMenuObjectFilter aFilterSMLConnectionActive = x -> SMPMetaManager.getSettings().isSMLEnabled();
    final IMenuObjectFilter aFilterSMLConnectionActiveOrNeeded = x -> SMPMetaManager.getSettings().isSMLEnabled() || SMPMetaManager.getSettings().isSMLRequired();
    {
        final IMenuItemPage aServiceGroups = aMenuTree.createRootItem(new PageSecureServiceGroup(CMenuSecure.MENU_SERVICE_GROUPS));
        aMenuTree.createItem(aServiceGroups, new PageSecureServiceGroupExport(CMenuSecure.MENU_SERVICE_GROUPS_EXPORT));
        aMenuTree.createItem(aServiceGroups, new PageSecureServiceGroupImport(CMenuSecure.MENU_SERVICE_GROUPS_IMPORT));
        aMenuTree.createItem(aServiceGroups, new PageSecureServiceGroupMigrationOutbound(CMenuSecure.MENU_SERVICE_GROUPS_MIGRATE_OUTBOUND));
        aMenuTree.createItem(aServiceGroups, new PageSecureServiceGroupMigrationInbound(CMenuSecure.MENU_SERVICE_GROUPS_MIGRATE_INBOUND));
    }
    {
        final IMenuItemPage aEndpoints = aMenuTree.createRootItem(new BasePageShowChildren<WebPageExecutionContext>(CMenuSecure.MENU_ENDPOINTS, "Endpoints", aMenuTree));
        aMenuTree.createItem(aEndpoints, new PageSecureEndpointList(CMenuSecure.MENU_ENDPOINT_LIST));
        aMenuTree.createItem(aEndpoints, new PageSecureEndpointTree(CMenuSecure.MENU_ENDPOINT_TREE));
        aMenuTree.createItem(aEndpoints, new PageSecureEndpointChangeURL(CMenuSecure.MENU_ENDPOINTS_CHANGE_URL));
        aMenuTree.createItem(aEndpoints, new PageSecureEndpointChangeCertificate(CMenuSecure.MENU_ENDPOINTS_CHANGE_CERTIFICATE));
    }
    aMenuTree.createRootItem(new PageSecureRedirect(CMenuSecure.MENU_REDIRECTS));
    aMenuTree.createRootItem(new PageSecureBusinessCard(CMenuSecure.MENU_BUSINESS_CARDS)).setDisplayFilter(aFilterPeppolDirectory);
    aMenuTree.createRootItem(new PageSecureCertificateInformation(CMenuSecure.MENU_CERTIFICATE_INFORMATION));
    aMenuTree.createRootItem(new PageSecureTasksProblems(CMenuSecure.MENU_TASKS));
    aMenuTree.createRootSeparator();
    // Administrator
    {
        final IMenuItemPage aAdmin = aMenuTree.createRootItem(new BasePageShowChildren<WebPageExecutionContext>(CMenuSecure.MENU_ADMIN, "Administration", aMenuTree));
        {
            final IMenuItemPage aAdminSML = aMenuTree.createItem(aAdmin, new BasePageShowChildren<>(CMenuSecure.MENU_SML, "SML", aMenuTree)).setDisplayFilter(aFilterSMLConnectionActiveOrNeeded);
            aMenuTree.createItem(aAdminSML, new PageSecureSMLConfiguration(CMenuSecure.MENU_SML_CONFIGURATION)).setDisplayFilter(aFilterSMLConnectionActiveOrNeeded);
            aMenuTree.createItem(aAdminSML, new PageSecureSMLRegistration(CMenuSecure.MENU_SML_REGISTRATION)).setDisplayFilter(aFilterSMLConnectionActive);
            aMenuTree.createItem(aAdminSML, new PageSecureSMLCertificateUpdate(CMenuSecure.MENU_SML_CERTIFICATE_UPDATE)).setDisplayFilter(aFilterSMLConnectionActive);
        }
        aMenuTree.createItem(aAdmin, new PageSecureSMPSettings(CMenuSecure.MENU_SMP_SETTINGS));
        aMenuTree.createItem(aAdmin, new PageSecureSMPIdentifierMappings(CMenuSecure.MENU_SMP_IDENTIFIER_MAPPINGS));
        aMenuTree.createItem(aAdmin, new PageSecureTransportProfiles(CMenuSecure.MENU_TRANSPORT_PROFILES));
        aMenuTree.createItem(aAdmin, new BasePageSecurityChangePassword<WebPageExecutionContext>(CMenuSecure.MENU_CHANGE_PASSWORD));
        BootstrapPagesMenuConfigurator.addAllItems(aMenuTree, aAdmin, aFilterAdministrators, CSMPServer.DEFAULT_LOCALE);
    }
    // Default menu item
    aMenuTree.setDefaultMenuItemID(CMenuSecure.MENU_SERVICE_GROUPS);
}
Also used : CSMPServer(com.helger.phoss.smp.CSMPServer) MenuObjectFilterUserAssignedToUserGroup(com.helger.photon.core.menu.filter.MenuObjectFilterUserAssignedToUserGroup) WebPageExecutionContext(com.helger.photon.uicore.page.WebPageExecutionContext) BootstrapPagesMenuConfigurator(com.helger.photon.bootstrap4.pages.BootstrapPagesMenuConfigurator) SMPMetaManager(com.helger.phoss.smp.domain.SMPMetaManager) IMenuItemPage(com.helger.photon.core.menu.IMenuItemPage) BasePageSecurityChangePassword(com.helger.photon.bootstrap4.pages.security.BasePageSecurityChangePassword) IMenuTree(com.helger.photon.core.menu.IMenuTree) CSMP(com.helger.phoss.smp.app.CSMP) BasePageShowChildren(com.helger.photon.uicore.page.system.BasePageShowChildren) Nonnull(javax.annotation.Nonnull) Immutable(javax.annotation.concurrent.Immutable) IMenuObjectFilter(com.helger.photon.core.menu.IMenuObjectFilter) IMenuItemPage(com.helger.photon.core.menu.IMenuItemPage) IMenuObjectFilter(com.helger.photon.core.menu.IMenuObjectFilter) BasePageSecurityChangePassword(com.helger.photon.bootstrap4.pages.security.BasePageSecurityChangePassword) BasePageShowChildren(com.helger.photon.uicore.page.system.BasePageShowChildren) MenuObjectFilterUserAssignedToUserGroup(com.helger.photon.core.menu.filter.MenuObjectFilterUserAssignedToUserGroup)

Aggregations

CSMPServer (com.helger.phoss.smp.CSMPServer)1 CSMP (com.helger.phoss.smp.app.CSMP)1 SMPMetaManager (com.helger.phoss.smp.domain.SMPMetaManager)1 BootstrapPagesMenuConfigurator (com.helger.photon.bootstrap4.pages.BootstrapPagesMenuConfigurator)1 BasePageSecurityChangePassword (com.helger.photon.bootstrap4.pages.security.BasePageSecurityChangePassword)1 IMenuItemPage (com.helger.photon.core.menu.IMenuItemPage)1 IMenuObjectFilter (com.helger.photon.core.menu.IMenuObjectFilter)1 IMenuTree (com.helger.photon.core.menu.IMenuTree)1 MenuObjectFilterUserAssignedToUserGroup (com.helger.photon.core.menu.filter.MenuObjectFilterUserAssignedToUserGroup)1 WebPageExecutionContext (com.helger.photon.uicore.page.WebPageExecutionContext)1 BasePageShowChildren (com.helger.photon.uicore.page.system.BasePageShowChildren)1 Nonnull (javax.annotation.Nonnull)1 Immutable (javax.annotation.concurrent.Immutable)1