Search in sources :

Example 1 with BasePageShowChildren

use of com.helger.photon.uicore.page.system.BasePageShowChildren in project peppol-practical by phax.

the class MenuPublic method init.

public static void init(@Nonnull final IMenuTree aMenuTree) {
    // Common stuff
    aMenuTree.createRootItem(new AppPageViewExternal(CMenuPublic.MENU_INDEX, "Overview", new ClassPathResource("viewpages/en/index.xml")));
    // News stuff
    {
        aMenuTree.createRootItem(new AppPageViewExternal(CMenuPublic.MENU_NEWS, "News", new ClassPathResource("viewpages/en/news.xml")));
    }
    // Setup stuff
    {
        final IMenuItemPage aSetup = aMenuTree.createRootItem(new BasePageShowChildren<WebPageExecutionContext>(CMenuPublic.MENU_DOCS, "Technical documentation", aMenuTree));
        aMenuTree.createItem(aSetup, new AppPageViewExternal(CMenuPublic.MENU_DOCS_SETUP_AP_PH, "Setup Peppol AP", new ClassPathResource("viewpages/en/docs_setup_ap.xml")));
        aMenuTree.createItem(aSetup, new AppPageViewExternal(CMenuPublic.MENU_DOCS_SETUP_SMP_PHOSS, "Setup phoss SMP", new ClassPathResource("viewpages/en/docs_setup_smp_phoss.xml")));
        if (false)
            aMenuTree.createItem(aSetup, new AppPageViewExternal(CMenuPublic.MENU_DOCS_SETUP_SMP_CIPA, "Setup CIPA SMP (deprecated)", new ClassPathResource("viewpages/en/invisible/docs_setup_smp_cipa.xml")));
        aMenuTree.createItem(aSetup, new AppPageViewExternal(CMenuPublic.MENU_DOCS_SMP_SML_INTERPLAY, "SMP and SML interactions", new ClassPathResource("viewpages/en/docs_smp_sml_interplay.xml")));
        aMenuTree.createItem(aSetup, new AppPageViewExternal(CMenuPublic.MENU_DOCS_SML_SUPPORT, "SML support", new ClassPathResource("viewpages/en/docs_sml_support.xml")));
        aMenuTree.createItem(aSetup, new AppPageViewExternal(CMenuPublic.MENU_DOCS_DOC_EXCHANGE, "Document exchange explained", new ClassPathResource("viewpages/en/docs_document_exchange.xml")));
        aMenuTree.createItem(aSetup, new AppPageViewExternal(CMenuPublic.MENU_DOCS_PEPPOL_PKI, "Peppol PKI explained", new ClassPathResource("viewpages/en/docs_peppol_pki.xml")));
        aMenuTree.createItem(aSetup, new AppPageViewExternal(CMenuPublic.MENU_DOCS_PEPPOL_CERT_UPDATE, "Peppol Certificate update", new ClassPathResource("viewpages/en/docs_peppol_cert_update.xml")));
        aMenuTree.createItem(aSetup, new AppPageViewExternal(CMenuPublic.MENU_DOCS_PEPPOL_DICT, "Peppol Dictionary/Abbreviations", new ClassPathResource("viewpages/en/docs_peppol_dict.xml")));
        aMenuTree.createItem(aSetup, new AppPageViewExternal(CMenuPublic.MENU_DOCS_SOFTWARE_VENDORS, "Software Vendors and Solutions", new ClassPathResource("viewpages/en/docs_software_vendors.xml")));
        // Not needed any more
        if (false)
            aMenuTree.createItem(aSetup, new AppPageViewExternal("docs-sml-migration", "SML migration information", new ClassPathResource("viewpages/en/invisible/docs_sml_migration.xml")));
    }
    // Tools stuff
    {
        final IMenuItemPage aSetup = aMenuTree.createRootItem(new BasePageShowChildren<WebPageExecutionContext>(CMenuPublic.MENU_TOOLS, "Tools", aMenuTree));
        aMenuTree.createItem(aSetup, new PagePublicToolsParticipantInformation(CMenuPublic.MENU_TOOLS_PARTICIPANT_INFO));
        aMenuTree.createItem(aSetup, new PagePublicToolsIdentifierInformation(CMenuPublic.MENU_TOOLS_ID_INFO));
        aMenuTree.createItem(aSetup, new PagePublicToolsSMPSML(CMenuPublic.MENU_TOOLS_SMP_SML));
        aMenuTree.createItem(aSetup, new PagePublicToolsTestEndpoints(CMenuPublic.MENU_TOOLS_TEST_ENDPOINTS));
        aMenuTree.createItem(aSetup, new AppPageViewExternal(CMenuPublic.MENU_TOOLS_REST_API, "REST API", new ClassPathResource("viewpages/en/rest_api.xml")));
    }
    // Validation stuff
    {
        final IMenuItemPage aValidation = aMenuTree.createRootItem(new BasePageShowChildren<WebPageExecutionContext>(CMenuPublic.MENU_VALIDATION, "Document Validation", aMenuTree));
        final IMenuItemPage aUpload = aMenuTree.createItem(aValidation, new PagePublicToolsDocumentValidation(CMenuPublic.MENU_VALIDATION_UPLOAD));
        aMenuTree.createRedirect("validation-bis2", aUpload);
        aMenuTree.createItem(aValidation, new AppPageViewExternal(CMenuPublic.MENU_VALIDATION_DVS, "Document Validation (WebService)", new ClassPathResource("viewpages/en/validation_dvs.xml")));
    }
    // EN 16931 - CEN/TC 434
    {
        aMenuTree.createRootItem(new AppPageViewExternal(CMenuPublic.MENU_EN16931, "EN 16931 - CEN/TC 434", new ClassPathResource("viewpages/en/en16931.xml")));
    }
    aMenuTree.createRootSeparator();
    // Newsletter stuff
    {
        aMenuTree.createRootItem(new PagePublicNewsletterSubscribe(CMenuPublic.MENU_NEWSLETTER_SUBSCRIBE));
        aMenuTree.createRootItem(new PagePublicNewsletterUnsubscribe(CMenuPublic.MENU_NEWSLETTER_UNSUBSCRIBE)).attrs().putIn(CMenuPublic.FLAG_FOOTER_COL2, true);
    }
    // Contact form
    {
        aMenuTree.createRootItem(new PagePublicContact(CMenuPublic.MENU_CONTACT));
    }
    aMenuTree.createRootSeparator();
    // Register/Login stuff
    {
        aMenuTree.createRootItem(new PagePublicLogin(CMenuPublic.MENU_LOGIN)).setDisplayFilter(new MenuObjectFilterNoUserLoggedIn());
        aMenuTree.createRootItem(new PagePublicSignUp(CMenuPublic.MENU_SIGN_UP)).setDisplayFilter(new MenuObjectFilterNoUserLoggedIn());
    }
    // Logged in user stuff
    {
        aMenuTree.createRootItem(new BasePageSecurityChangePassword<WebPageExecutionContext>(CMenuPublic.MENU_CHANGE_PASSWORD)).setDisplayFilter(new MenuObjectFilterUserLoggedIn());
    }
    aMenuTree.createRootSeparator();
    // External stuff
    {
        aMenuTree.createRootItem(CMenuPublic.MENU_PEPPOL_SERVICE_DESK, new SimpleURL("https://openpeppol.atlassian.net/servicedesk/customer/portal/1"), new ConstantHasDisplayText("OpenPeppol Service Desk (external)"));
    }
    // Set default
    aMenuTree.setDefaultMenuItemID(CMenuPublic.MENU_NEWS);
}
Also used : AppPageViewExternal(com.helger.peppol.ui.page.AppPageViewExternal) IMenuItemPage(com.helger.photon.core.menu.IMenuItemPage) ClassPathResource(com.helger.commons.io.resource.ClassPathResource) SimpleURL(com.helger.commons.url.SimpleURL) WebPageExecutionContext(com.helger.photon.uicore.page.WebPageExecutionContext) BasePageShowChildren(com.helger.photon.uicore.page.system.BasePageShowChildren) MenuObjectFilterNoUserLoggedIn(com.helger.photon.core.menu.filter.MenuObjectFilterNoUserLoggedIn) MenuObjectFilterUserLoggedIn(com.helger.photon.core.menu.filter.MenuObjectFilterUserLoggedIn) ConstantHasDisplayText(com.helger.commons.text.display.ConstantHasDisplayText)

Example 2 with BasePageShowChildren

use of com.helger.photon.uicore.page.system.BasePageShowChildren in project phoss-directory by phax.

the class MenuSecure method init.

public static void init(@Nonnull final IMenuTree aMenuTree) {
    // We need this additional indirection layer, as the pages are initialized
    // statically!
    final MenuObjectFilterUserAssignedToUserGroup aFilterAdministrators = new MenuObjectFilterUserAssignedToUserGroup(AppSecurity.USERGROUP_ADMINISTRATORS_ID);
    // Indexer
    {
        final IMenuItemPage aIndexer = aMenuTree.createRootItem(new BasePageShowChildren<>(CMenuSecure.MENU_INDEXER, "Indexer", aMenuTree));
        aMenuTree.createItem(aIndexer, new PageSecureParticipantCount(CMenuSecure.MENU_PARTICIPANT_COUNT));
        aMenuTree.createItem(aIndexer, new PageSecureParticipantList(CMenuSecure.MENU_PARTICIPANT_LIST));
        aMenuTree.createItem(aIndexer, new PageSecureParticipantActions(CMenuSecure.MENU_PARTICIPANT_ACTIONS));
        aMenuTree.createItem(aIndexer, new PageSecureIndexManually(CMenuSecure.MENU_INDEX_MANUALLY));
        aMenuTree.createItem(aIndexer, new PageSecureIndexImport(CMenuSecure.MENU_INDEX_IMPORT));
        aMenuTree.createItem(aIndexer, new PageSecureDeleteManually(CMenuSecure.MENU_DELETE_MANUALLY));
        aMenuTree.createSeparator(aIndexer);
        aMenuTree.createItem(aIndexer, new PageSecureListIndex(CMenuSecure.MENU_LIST_INDEX));
        aMenuTree.createItem(aIndexer, new PageSecureListReIndex(CMenuSecure.MENU_LIST_RE_INDEX));
        aMenuTree.createItem(aIndexer, new PageSecureListDeadIndex(CMenuSecure.MENU_LIST_DEAD_INDEX));
    }
    // Administrator
    {
        final IMenuItemPage aAdmin = aMenuTree.createRootItem(new BasePageShowChildren<>(CMenuSecure.MENU_ADMIN, "Administration", aMenuTree));
        aMenuTree.createItem(aAdmin, new BasePageSecurityChangePassword<>(CMenuSecure.MENU_ADMIN_CHANGE_PASSWORD));
        aMenuTree.createItem(aAdmin, new PageSecureAdminSMLConfiguration(CMenuSecure.MENU_ADMIN_SML_CONFIGURATION));
        aMenuTree.createItem(aAdmin, new PageSecureAdminLuceneInformation(CMenuSecure.MENU_ADMIN_LUCENE_INFO));
        BootstrapPagesMenuConfigurator.addAllItems(aMenuTree, aAdmin, aFilterAdministrators, AppCommonUI.DEFAULT_LOCALE);
    }
    // Default menu item
    aMenuTree.setDefaultMenuItemID(CMenuSecure.MENU_INDEXER);
}
Also used : IMenuItemPage(com.helger.photon.core.menu.IMenuItemPage) BasePageSecurityChangePassword(com.helger.photon.bootstrap4.pages.security.BasePageSecurityChangePassword) BasePageShowChildren(com.helger.photon.uicore.page.system.BasePageShowChildren) MenuObjectFilterUserAssignedToUserGroup(com.helger.photon.core.menu.filter.MenuObjectFilterUserAssignedToUserGroup)

Example 3 with BasePageShowChildren

use of com.helger.photon.uicore.page.system.BasePageShowChildren 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)

Example 4 with BasePageShowChildren

use of com.helger.photon.uicore.page.system.BasePageShowChildren in project peppol-practical by phax.

the class MenuSecure method init.

public static void init(@Nonnull final IMenuTree aMenuTree) {
    // We need this additional indirection layer, as the pages are initialized
    // statically!
    final MenuObjectFilterUserAssignedToUserGroup aFilterAdministrators = new MenuObjectFilterUserAssignedToUserGroup(CPPApp.USERGROUP_ADMINISTRATORS_ID);
    final MenuObjectFilterUserHasRole aFilterPeppolSenders = new MenuObjectFilterUserHasRole(CPPApp.ROLE_PEPPOL_SENDERS_ID);
    // CRM
    {
        final IMenuItemPage aCRM = aMenuTree.createRootItem(new BasePageShowChildren<WebPageExecutionContext>(CMenuSecure.MENU_CRM, "CRM", aMenuTree)).setDisplayFilter(aFilterAdministrators);
        aMenuTree.createItem(aCRM, new PageSecureCRMGroup(CMenuSecure.MENU_CRM_GROUPS)).setDisplayFilter(aFilterAdministrators);
        aMenuTree.createItem(aCRM, new PageSecureCRMSubscriber(CMenuSecure.MENU_CRM_SUBSCRIBERS)).setDisplayFilter(aFilterAdministrators);
    }
    // Peppol
    {
        final IMenuItemPage aPeppol = aMenuTree.createRootItem(new BasePageShowChildren<WebPageExecutionContext>(CMenuSecure.MENU_PEPPOL, "Peppol", aMenuTree));
        aMenuTree.createItem(aPeppol, new PageSecurePeppolSendAS4(CMenuSecure.MENU_PEPPOL_SEND_AS4)).setDisplayFilter(aFilterPeppolSenders);
    }
    // Comments
    {
        aMenuTree.createRootItem(new PageSecureCommentAdmin(CMenuSecure.MENU_COMMENTS)).setDisplayFilter(aFilterAdministrators);
    }
    // Schematron tools
    {
        aMenuTree.createRootItem(new PageSecureSchematronTools(CMenuSecure.MENU_SCH_TOOLS)).setDisplayFilter(aFilterAdministrators);
    }
    // Administrator
    {
        final IMenuItemPage aAdmin = aMenuTree.createRootItem(new BasePageShowChildren<WebPageExecutionContext>(CMenuSecure.MENU_ADMIN, "Administration", aMenuTree));
        // Must be accessible for all Config users
        aMenuTree.createItem(aAdmin, new BasePageSecurityChangePassword<WebPageExecutionContext>(CMenuSecure.MENU_ADMIN_CHANGE_PASSWORD));
        // Admins only
        aMenuTree.createItem(aAdmin, new PageSecureAdminAddons(CMenuSecure.MENU_ADMIN_ADDONS)).setDisplayFilter(aFilterAdministrators);
        aMenuTree.createItem(aAdmin, new PageSecureSMLConfiguration(CMenuSecure.MENU_SML_CONFIGURATION)).setDisplayFilter(aFilterAdministrators);
        BootstrapPagesMenuConfigurator.addAllItems(aMenuTree, aAdmin, aFilterAdministrators, CPPApp.DEFAULT_LOCALE);
    }
    // Default menu item
    aMenuTree.setDefaultMenuItemID(CMenuSecure.MENU_COMMENTS);
}
Also used : IMenuItemPage(com.helger.photon.core.menu.IMenuItemPage) MenuObjectFilterUserHasRole(com.helger.photon.core.menu.filter.MenuObjectFilterUserHasRole) BasePageSecurityChangePassword(com.helger.photon.bootstrap4.pages.security.BasePageSecurityChangePassword) WebPageExecutionContext(com.helger.photon.uicore.page.WebPageExecutionContext) BasePageShowChildren(com.helger.photon.uicore.page.system.BasePageShowChildren) MenuObjectFilterUserAssignedToUserGroup(com.helger.photon.core.menu.filter.MenuObjectFilterUserAssignedToUserGroup)

Aggregations

IMenuItemPage (com.helger.photon.core.menu.IMenuItemPage)4 BasePageShowChildren (com.helger.photon.uicore.page.system.BasePageShowChildren)4 BasePageSecurityChangePassword (com.helger.photon.bootstrap4.pages.security.BasePageSecurityChangePassword)3 MenuObjectFilterUserAssignedToUserGroup (com.helger.photon.core.menu.filter.MenuObjectFilterUserAssignedToUserGroup)3 WebPageExecutionContext (com.helger.photon.uicore.page.WebPageExecutionContext)3 ClassPathResource (com.helger.commons.io.resource.ClassPathResource)1 ConstantHasDisplayText (com.helger.commons.text.display.ConstantHasDisplayText)1 SimpleURL (com.helger.commons.url.SimpleURL)1 AppPageViewExternal (com.helger.peppol.ui.page.AppPageViewExternal)1 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 IMenuObjectFilter (com.helger.photon.core.menu.IMenuObjectFilter)1 IMenuTree (com.helger.photon.core.menu.IMenuTree)1 MenuObjectFilterNoUserLoggedIn (com.helger.photon.core.menu.filter.MenuObjectFilterNoUserLoggedIn)1 MenuObjectFilterUserHasRole (com.helger.photon.core.menu.filter.MenuObjectFilterUserHasRole)1 MenuObjectFilterUserLoggedIn (com.helger.photon.core.menu.filter.MenuObjectFilterUserLoggedIn)1 Nonnull (javax.annotation.Nonnull)1 Immutable (javax.annotation.concurrent.Immutable)1