Search in sources :

Example 1 with HCNodeList

use of com.helger.html.hc.impl.HCNodeList in project phoss-directory by phax.

the class PageSecureListIndex method fillContent.

@Override
protected void fillContent(final WebPageExecutionContext aWPEC) {
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    // Add toolbar
    {
        final BootstrapButtonToolbar aToolbar = aNodeList.addAndReturnChild(new BootstrapButtonToolbar(aWPEC));
        aToolbar.addChild(new BootstrapButton().addChild("Refresh").setIcon(EDefaultIcon.REFRESH).setOnClick(aWPEC.getSelfHref()));
        aToolbar.addChild(span("Current server time: " + PDTToString.getAsString(PDTFactory.getCurrentLocalTime(), aDisplayLocale)).addClass(PDCommonUI.CSS_CLASS_VERTICAL_PADDED_TEXT));
    }
    final LinkedBlockingQueue<Object> aQueue = PDMetaManager.getIndexerMgr().getIndexerWorkQueue().getQueue();
    final int nLength = aQueue.size();
    if (nLength == 0) {
        aNodeList.addChild(success("The Index Queue is currently empty"));
    } else {
        aNodeList.addChild(info("The Index Queue contains " + nLength + " entries"));
        final BootstrapTable aTable = new BootstrapTable(new DTCol("Queue date time").setDisplayType(EDTColType.DATETIME, aDisplayLocale).setInitialSorting(ESortOrder.DESCENDING), new DTCol("Participant ID"), new DTCol("Action"), new DTCol("Owner"), new DTCol("Requestor")).setID("indexqueue");
        for (final Object o : aQueue) if (o instanceof IIndexerWorkItem) {
            final IIndexerWorkItem aObj = (IIndexerWorkItem) o;
            final HCRow aRow = aTable.addBodyRow();
            aRow.addCell(PDTToString.getAsString(aObj.getCreationDateTime(), aDisplayLocale));
            aRow.addCell(aObj.getParticipantID().getURIEncoded());
            aRow.addCell(aObj.getType().getDisplayName());
            aRow.addCell(aObj.getOwnerID());
            aRow.addCell(aObj.getRequestingHost());
        }
        aNodeList.addChild(aTable).addChild(BootstrapDataTables.createDefaultDataTables(aWPEC, aTable));
    }
}
Also used : Locale(java.util.Locale) IIndexerWorkItem(com.helger.pd.indexer.index.IIndexerWorkItem) HCNodeList(com.helger.html.hc.impl.HCNodeList) BootstrapTable(com.helger.photon.bootstrap4.table.BootstrapTable) DTCol(com.helger.photon.uictrls.datatables.column.DTCol) HCRow(com.helger.html.hc.html.tabular.HCRow) BootstrapButton(com.helger.photon.bootstrap4.button.BootstrapButton) BootstrapButtonToolbar(com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar)

Example 2 with HCNodeList

use of com.helger.html.hc.impl.HCNodeList in project phoss-directory by phax.

the class PageSecureParticipantActions method _deleteDuplicateIDs.

private void _deleteDuplicateIDs(@Nonnull final WebPageExecutionContext aWPEC) {
    LOGGER.info("Deleting all duplicate participant identifiers");
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final ICommonsMap<IParticipantIdentifier, ICommonsSortedSet<String>> aDupMap = _getDuplicateSourceMap();
    final ICommonsSortedSet<String> aPIsToDelete = new CommonsTreeSet<>();
    final ICommonsSortedSet<String> aPIsToAdd = new CommonsTreeSet<>();
    for (final Map.Entry<IParticipantIdentifier, ICommonsSortedSet<String>> aEntry : aDupMap.entrySet()) {
        final ICommonsSortedSet<String> aSet = aEntry.getValue();
        final IParticipantIdentifier aPI = aEntry.getKey();
        final String sDesiredVersion = aPI.getURIEncoded();
        if (aSet.contains(sDesiredVersion)) {
            // Simple kill the other ones
            aPIsToDelete.addAll(aSet, x -> !x.equals(sDesiredVersion));
        } else {
            // Remove all and index the correct version
            aPIsToDelete.addAll(aSet);
            aPIsToAdd.add(sDesiredVersion);
        }
    }
    if (aPIsToDelete.isNotEmpty()) {
        final HCNodeList aNL = new HCNodeList();
        // Important to use this identifier factory so that the correct key is
        // created
        final IIdentifierFactory aIF = SimpleIdentifierFactory.INSTANCE;
        final PDIndexerManager aIndexerMgr = PDMetaManager.getIndexerMgr();
        String sMsg = "Deleting " + aPIsToDelete.size() + " participant ID(s):";
        LOGGER.info(sMsg);
        aNL.addChild(h2(sMsg));
        HCOL aOL = aNL.addAndReturnChild(new HCOL());
        for (final String s : aPIsToDelete.getSorted(IComparator.getComparatorCollating(aDisplayLocale))) {
            aOL.addItem(s);
            aIndexerMgr.queueWorkItem(aIF.parseParticipantIdentifier(s), EIndexerWorkItemType.DELETE, "duplicate-elimination", PDIndexerManager.HOST_LOCALHOST);
        }
        if (aPIsToAdd.isNotEmpty()) {
            sMsg = "Adding " + aPIsToAdd.size() + " participant ID(s) instead:";
            LOGGER.info(sMsg);
            aNL.addChild(h2(sMsg));
            aOL = aNL.addAndReturnChild(new HCOL());
            for (final String s : aPIsToAdd.getSorted(IComparator.getComparatorCollating(aDisplayLocale))) {
                aOL.addItem(s);
                aIndexerMgr.queueWorkItem(aIF.parseParticipantIdentifier(s), EIndexerWorkItemType.CREATE_UPDATE, "duplicate-elimination", PDIndexerManager.HOST_LOCALHOST);
            }
        }
        aWPEC.postRedirectGetInternal(aNL);
    } else {
        final String sMsg = "Found no duplicate entries to remove";
        LOGGER.info(sMsg);
        aWPEC.postRedirectGetInternal(success(sMsg));
    }
}
Also used : Locale(java.util.Locale) HCNodeList(com.helger.html.hc.impl.HCNodeList) CommonsTreeSet(com.helger.commons.collection.impl.CommonsTreeSet) PDTToString(com.helger.commons.datetime.PDTToString) ICommonsSortedSet(com.helger.commons.collection.impl.ICommonsSortedSet) HCOL(com.helger.html.hc.html.grouping.HCOL) Map(java.util.Map) ICommonsMap(com.helger.commons.collection.impl.ICommonsMap) CommonsHashMap(com.helger.commons.collection.impl.CommonsHashMap) IIdentifierFactory(com.helger.peppolid.factory.IIdentifierFactory) PDIndexerManager(com.helger.pd.indexer.mgr.PDIndexerManager) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier)

Example 3 with HCNodeList

use of com.helger.html.hc.impl.HCNodeList in project phoss-directory by phax.

the class PageSecureParticipantActions method _showDuplicateIDs.

private void _showDuplicateIDs(@Nonnull final WebPageExecutionContext aWPEC) {
    // This method can take a couple of minutes
    LOGGER.info("Showing all duplicate participant identifiers");
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final ICommonsMap<IParticipantIdentifier, ICommonsSortedSet<String>> aDupMap = _getDuplicateSourceMap();
    final HCNodeList aNL = new HCNodeList();
    for (final Map.Entry<IParticipantIdentifier, ICommonsSortedSet<String>> aEntry : aDupMap.entrySet()) {
        final ICommonsSortedSet<String> aSet = aEntry.getValue();
        final IParticipantIdentifier aPI = aEntry.getKey();
        final String sDesiredVersion = aPI.getURIEncoded();
        final HCDiv aDiv = div("Found " + aSet.size() + " duplicate IDs for ").addChild(code(sDesiredVersion)).addChild(":");
        final HCOL aOL = aDiv.addAndReturnChild(new HCOL());
        for (final String sVersion : aSet.getSorted(IComparator.getComparatorCollating(aDisplayLocale))) {
            final boolean bIsDesired = sDesiredVersion.equals(sVersion);
            final IHCLI<?> aLI = aOL.addAndReturnItem(code(sVersion));
            if (bIsDesired)
                aLI.addChild(" ").addChild(badgeSuccess("desired version"));
        }
        aNL.addChild(aDiv);
    }
    if (aNL.hasChildren()) {
        final String sMsg = "Found duplicate entries for " + aDupMap.size() + " " + (aDupMap.size() == 1 ? "participant" : "participants");
        LOGGER.info(sMsg);
        aNL.addChildAt(0, h2(sMsg));
        aWPEC.postRedirectGetInternal(aNL);
    } else
        aWPEC.postRedirectGetInternal(success("Found no duplicate entries"));
}
Also used : Locale(java.util.Locale) HCDiv(com.helger.html.hc.html.grouping.HCDiv) HCNodeList(com.helger.html.hc.impl.HCNodeList) PDTToString(com.helger.commons.datetime.PDTToString) ICommonsSortedSet(com.helger.commons.collection.impl.ICommonsSortedSet) HCOL(com.helger.html.hc.html.grouping.HCOL) Map(java.util.Map) ICommonsMap(com.helger.commons.collection.impl.ICommonsMap) CommonsHashMap(com.helger.commons.collection.impl.CommonsHashMap) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier)

Example 4 with HCNodeList

use of com.helger.html.hc.impl.HCNodeList in project phoss-directory by phax.

the class PageSecureParticipantActions method fillContent.

@Override
protected void fillContent(@Nonnull final WebPageExecutionContext aWPEC) {
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final IRequestWebScopeWithoutResponse aRequestScope = aWPEC.getRequestScope();
    if (aWPEC.hasAction(ACTION_UPDATE_EXPORTED_BCS)) {
        LOGGER.info("Manually exporting all Business Cards now");
        // run in the background
        ExportAllDataJob.exportAllBusinessCardsInBackground();
        aWPEC.postRedirectGetInternal(success("The new exported data is (hopefully) available in a few minutes. Check the 'is running' state below."));
    } else if (aWPEC.hasAction(ACTION_SYNC_BCS_UNFORCED)) {
        LOGGER.info("Manually synchronizing all Business Cards now (unforced)");
        if (SyncAllBusinessCardsJob.syncAllBusinessCards(false).isChanged())
            aWPEC.postRedirectGetInternal(success("The unforced synchronization was started successfully and is now running in the background."));
        else
            aWPEC.postRedirectGetInternal(warn("The synchronization was not started because the last sync was at " + PDTToString.getAsString(SyncAllBusinessCardsJob.getLastSync(), aDisplayLocale)));
    } else if (aWPEC.hasAction(ACTION_SYNC_BCS_FORCED)) {
        LOGGER.info("Manually synchronizing all Business Cards now (FORCED)");
        if (SyncAllBusinessCardsJob.syncAllBusinessCards(true).isChanged())
            aWPEC.postRedirectGetInternal(success("The forced synchronization was started successfully and is now running in the background."));
        else
            aWPEC.postRedirectGetInternal(error("Force synchronization should always work"));
    } else if (aWPEC.hasAction(ACTION_SHOW_DUPLICATES)) {
        _showDuplicateIDs(aWPEC);
    } else if (aWPEC.hasAction(ACTION_DELETE_DUPLICATES)) {
        _deleteDuplicateIDs(aWPEC);
    }
    {
        final BootstrapButtonToolbar aToolbar = new BootstrapButtonToolbar(aWPEC);
        aToolbar.addButton("Refresh", aWPEC.getSelfHref(), EDefaultIcon.MAGNIFIER);
        aNodeList.addChild(aToolbar);
    }
    final BootstrapCard aCard = aNodeList.addAndReturnChild(new BootstrapCard());
    aCard.createAndAddHeader().addChild("Live data downloads - Danger zone").addClasses(CBootstrapCSS.BG_DANGER, CBootstrapCSS.TEXT_WHITE);
    BootstrapCardBody aBody = aCard.createAndAddBody();
    aBody.addChild(new BootstrapButton(EBootstrapButtonType.DANGER).addChild("Download all IDs (XML, live)").setOnClick(AJAX_DOWNLOAD_ALL_IDS_XML.getInvocationURL(aRequestScope)).setIcon(EDefaultIcon.SAVE_ALL));
    aBody.addChild(new BootstrapButton(EBootstrapButtonType.DANGER).addChild("Download all Business Cards (XML, full, live) (may take long)").setOnClick(AJAX_DOWNLOAD_ALL_BCS_XML_FULL.getInvocationURL(aRequestScope)).setIcon(EDefaultIcon.SAVE_ALL));
    aBody.addChild(new BootstrapButton(EBootstrapButtonType.DANGER).addChild("Download all Business Cards (XML, no document types, live) (may take long)").setOnClick(AJAX_DOWNLOAD_ALL_BCS_XML_NO_DOCTYPES.getInvocationURL(aRequestScope)).setIcon(EDefaultIcon.SAVE_ALL));
    aBody.addChild(new BootstrapButton(EBootstrapButtonType.DANGER).addChild("Download all Business Cards (Excel, live) (may take long)").setOnClick(AJAX_DOWNLOAD_ALL_BCS_EXCEL.getInvocationURL(aRequestScope)).setIcon(EDefaultIcon.SAVE_ALL));
    aBody.addChild(new BootstrapButton(EBootstrapButtonType.DANGER).addChild("Download all Business Cards (CSV, live) (may take long)").setOnClick(AJAX_DOWNLOAD_ALL_BCS_CSV.getInvocationURL(aRequestScope)).setIcon(EDefaultIcon.SAVE_ALL));
    aCard.createAndAddHeader().addChild("Cached data downloads");
    aBody = aCard.createAndAddBody();
    aBody.addChild(new BootstrapButton().addChild("Download all Business Cards (XML, full, cached)").setOnClick(LinkHelper.getURLWithContext(aRequestScope, ExportServlet.SERVLET_DEFAULT_PATH + ExportDeliveryHttpHandler.SPECIAL_BUSINESS_CARDS_XML_FULL)).setIcon(EDefaultIcon.SAVE_ALL));
    aBody.addChild(new BootstrapButton().addChild("Download all Business Cards (XML, no document types, cached)").setOnClick(LinkHelper.getURLWithContext(aRequestScope, ExportServlet.SERVLET_DEFAULT_PATH + ExportDeliveryHttpHandler.SPECIAL_BUSINESS_CARDS_XML_NO_DOC_TYPES)).setIcon(EDefaultIcon.SAVE_ALL));
    if (CPDPublisher.EXPORT_BUSINESS_CARDS_EXCEL) {
        aBody.addChild(new BootstrapButton().addChild("Download all Business Cards (Excel, cached)").setOnClick(LinkHelper.getURLWithContext(aRequestScope, ExportServlet.SERVLET_DEFAULT_PATH + ExportDeliveryHttpHandler.SPECIAL_BUSINESS_CARDS_EXCEL)).setIcon(EDefaultIcon.SAVE_ALL));
    }
    if (CPDPublisher.EXPORT_BUSINESS_CARDS_CSV) {
        aBody.addChild(new BootstrapButton().addChild("Download all Business Cards (CSV, cached)").setOnClick(LinkHelper.getURLWithContext(aRequestScope, ExportServlet.SERVLET_DEFAULT_PATH + ExportDeliveryHttpHandler.SPECIAL_BUSINESS_CARDS_CSV)).setIcon(EDefaultIcon.SAVE_ALL));
    }
    if (CPDPublisher.EXPORT_PARTICIPANTS_XML) {
        aBody.addChild(new BootstrapButton().addChild("Download all Participants (XML, cached)").setOnClick(LinkHelper.getURLWithContext(aRequestScope, ExportServlet.SERVLET_DEFAULT_PATH + ExportDeliveryHttpHandler.SPECIAL_PARTICIPANTS_XML)).setIcon(EDefaultIcon.SAVE_ALL));
    }
    if (CPDPublisher.EXPORT_PARTICIPANTS_JSON) {
        aBody.addChild(new BootstrapButton().addChild("Download all Participants (JSON, cached)").setOnClick(LinkHelper.getURLWithContext(aRequestScope, ExportServlet.SERVLET_DEFAULT_PATH + ExportDeliveryHttpHandler.SPECIAL_PARTICIPANTS_JSON)).setIcon(EDefaultIcon.SAVE_ALL));
    }
    if (CPDPublisher.EXPORT_PARTICIPANTS_CSV) {
        aBody.addChild(new BootstrapButton().addChild("Download all Participants (CSV, cached)").setOnClick(LinkHelper.getURLWithContext(aRequestScope, ExportServlet.SERVLET_DEFAULT_PATH + ExportDeliveryHttpHandler.SPECIAL_PARTICIPANTS_CSV)).setIcon(EDefaultIcon.SAVE_ALL));
    }
    aCard.createAndAddHeader().addChild("Cache management");
    aBody = aCard.createAndAddBody();
    final boolean bIsRunning = ExportAllDataJob.isExportCurrentlyRunning();
    if (bIsRunning) {
        final LocalDateTime aStartDT = ExportAllDataJob.getExportAllBusinessCardsStartDT();
        aBody.addChild(info("Export of Business Card cache is currently running. Started at " + PDTToString.getAsString(aStartDT, aDisplayLocale)));
    }
    aBody.addChild(new BootstrapButton().addChild("Update Business Card export cache (in background; takes too long)").setOnClick(aWPEC.getSelfHref().add(CPageParam.PARAM_ACTION, ACTION_UPDATE_EXPORTED_BCS)).setIcon(EDefaultIcon.INFO).setDisabled(bIsRunning));
    aCard.createAndAddHeader().addChild("Data Synchronization");
    aBody = aCard.createAndAddBody();
    aBody.addChild(new BootstrapButton().addChild("Synchronize all Business Cards (re-query from SMP - unforced)").setOnClick(aWPEC.getSelfHref().add(CPageParam.PARAM_ACTION, ACTION_SYNC_BCS_UNFORCED)).setIcon(EDefaultIcon.REFRESH));
    aBody.addChild(new BootstrapButton(EBootstrapButtonType.DANGER).addChild("Synchronize all Business Cards (re-query from SMP - forced)").setOnClick(aWPEC.getSelfHref().add(CPageParam.PARAM_ACTION, ACTION_SYNC_BCS_FORCED)).setIcon(EDefaultIcon.REFRESH));
    aCard.createAndAddHeader().addChild("Duplication handling");
    aBody = aCard.createAndAddBody();
    if (PDMetaManager.getIdentifierFactory() instanceof SimpleIdentifierFactory) {
        aBody.addChild(info("Since the simple identifier factory is used, duplicates cannot be determined"));
    } else {
        aBody.addChild(new BootstrapButton().addChild("Show all duplicate entries").setOnClick(aWPEC.getSelfHref().add(CPageParam.PARAM_ACTION, ACTION_SHOW_DUPLICATES)).setIcon(EDefaultIcon.MAGNIFIER));
        aBody.addChild(new BootstrapButton(EBootstrapButtonType.DANGER).addChild("Delete all duplicate entries").setOnClick(aWPEC.getSelfHref().add(CPageParam.PARAM_ACTION, ACTION_DELETE_DUPLICATES)).setIcon(EDefaultIcon.DELETE));
    }
}
Also used : Locale(java.util.Locale) LocalDateTime(java.time.LocalDateTime) IRequestWebScopeWithoutResponse(com.helger.web.scope.IRequestWebScopeWithoutResponse) BootstrapCard(com.helger.photon.bootstrap4.card.BootstrapCard) HCNodeList(com.helger.html.hc.impl.HCNodeList) SimpleIdentifierFactory(com.helger.peppolid.factory.SimpleIdentifierFactory) BootstrapCardBody(com.helger.photon.bootstrap4.card.BootstrapCardBody) BootstrapButton(com.helger.photon.bootstrap4.button.BootstrapButton) BootstrapButtonToolbar(com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar)

Example 5 with HCNodeList

use of com.helger.html.hc.impl.HCNodeList in project phoss-directory by phax.

the class AbstractPagePublicSearch method createParticipantDetails.

@Nonnull
protected HCNodeList createParticipantDetails(@Nonnull final Locale aDisplayLocale, @Nonnull final String sParticipantID, @Nonnull final IParticipantIdentifier aParticipantID, final boolean bIsLoggedInUserAdministrator) {
    final HCNodeList aDetails = new HCNodeList();
    // Search document matching participant ID
    final ICommonsList<PDStoredBusinessEntity> aResultDocs = PDMetaManager.getStorageMgr().getAllDocumentsOfParticipant(aParticipantID);
    // Group by participant ID
    final ICommonsMap<IParticipantIdentifier, ICommonsList<PDStoredBusinessEntity>> aGroupedDocs = PDStorageManager.getGroupedByParticipantID(aResultDocs);
    if (aGroupedDocs.isEmpty())
        LOGGER.error("No stored document matches participant identifier '" + sParticipantID + "' - cannot show details");
    else {
        if (aGroupedDocs.size() > 1)
            LOGGER.warn("Found " + aGroupedDocs.size() + " entries for participant identifier '" + sParticipantID + "' - weird");
        // Get the first one
        final ICommonsList<PDStoredBusinessEntity> aStoredEntities = aGroupedDocs.getFirstValue();
        // Details header
        {
            IHCNode aDetailsHeader = null;
            final boolean bIsPeppolDefault = aParticipantID.hasScheme(PeppolIdentifierFactory.INSTANCE.getDefaultParticipantIdentifierScheme());
            if (bIsPeppolDefault) {
                final IParticipantIdentifierScheme aIIA = ParticipantIdentifierSchemeManager.getSchemeOfIdentifier(aParticipantID);
                if (aIIA != null) {
                    final HCH1 aH1 = h1("Details for: " + aParticipantID.getValue());
                    if (StringHelper.hasText(aIIA.getSchemeAgency()))
                        aH1.addChild(small(" (" + aIIA.getSchemeAgency() + ")"));
                    aDetailsHeader = new BootstrapPageHeader().addChild(aH1);
                }
            }
            if (aDetailsHeader == null) {
                // Fallback
                aDetailsHeader = BootstrapWebPageUIHandler.INSTANCE.createPageHeader("Details for " + sParticipantID);
            }
            aDetails.addChild(aDetailsHeader);
        }
        final BootstrapTabBox aTabBox = new BootstrapTabBox();
        // Business information
        {
            final HCNodeList aOL = new HCNodeList();
            int nIndex = 1;
            for (final PDStoredBusinessEntity aStoredEntity : aStoredEntities) {
                final BootstrapCard aCard = aOL.addAndReturnChild(new BootstrapCard());
                aCard.addClass(CSS_CLASS_RESULT_PANEL);
                if (aStoredEntities.size() > 1)
                    aCard.createAndAddHeader().addChild("Business information entity " + nIndex);
                final BootstrapViewForm aViewForm = PDCommonUI.showBusinessInfoDetails(aStoredEntity, aDisplayLocale);
                aViewForm.addFormGroup(new BootstrapFormGroup().setLabel("Full Peppol participant ID").setCtrl(code(sParticipantID)));
                if (GlobalDebug.isDebugMode() || bIsLoggedInUserAdministrator) {
                    aViewForm.addChild(new HCHR());
                    aViewForm.addFormGroup(new BootstrapFormGroup().setLabel("[Debug] Creation DT").setCtrl(PDTToString.getAsString(aStoredEntity.getMetaData().getCreationDT(), aDisplayLocale)));
                    aViewForm.addFormGroup(new BootstrapFormGroup().setLabel("[Debug] Owner ID").setCtrl(code(aStoredEntity.getMetaData().getOwnerID())));
                    aViewForm.addFormGroup(new BootstrapFormGroup().setLabel("[Debug] Requesting Host").setCtrl(code(aStoredEntity.getMetaData().getRequestingHost())));
                }
                aCard.createAndAddBody().addChild(aViewForm);
                ++nIndex;
            }
            // Add whole list or just the first item?
            final IHCNode aTabLabel = span("Business information ").addChild(badgePrimary(aStoredEntities.size()));
            aTabBox.addTab("businessinfo", aTabLabel, aOL, true);
        }
        // Document types
        {
            final HCNodeList aDocTypeCtrl = new HCNodeList();
            final ICommonsList<String> aNames = new CommonsArrayList<>();
            for (final PDStoredBusinessEntity aStoredEntity : aStoredEntities) aNames.addAllMapped(aStoredEntity.names(), PDStoredMLName::getName);
            aDocTypeCtrl.addChild(info("The following document types are supported by " + _getImplodedMapped(", ", " and ", aNames, x -> "'" + x + "'") + ":"));
            HCOL aDocTypeOL = null;
            final ICommonsList<IDocumentTypeIdentifier> aDocTypeIDs = aResultDocs.getFirst().documentTypeIDs().getSorted(IDocumentTypeIdentifier.comparator());
            for (final IDocumentTypeIdentifier aDocTypeID : aDocTypeIDs) {
                if (aDocTypeOL == null)
                    aDocTypeOL = aDocTypeCtrl.addAndReturnChild(new HCOL());
                final HCLI aLI = aDocTypeOL.addItem();
                aLI.addChild(NiceNameUI.getDocumentTypeID(aDocTypeID));
            }
            if (aDocTypeOL == null)
                aDocTypeCtrl.addChild(warn("This participant does not support any document types!"));
            aTabBox.addTab("doctypes", span("Supported document types ").addChild(badgePrimary(aDocTypeIDs.size())), aDocTypeCtrl, false);
        }
        aDetails.addChild(aTabBox);
    }
    return aDetails;
}
Also used : HCH1(com.helger.html.hc.html.sections.HCH1) HCOL(com.helger.html.hc.html.grouping.HCOL) IDocumentTypeIdentifier(com.helger.peppolid.IDocumentTypeIdentifier) BootstrapWebPageUIHandler(com.helger.photon.bootstrap4.pages.BootstrapWebPageUIHandler) PDMetaManager(com.helger.pd.indexer.mgr.PDMetaManager) LoggerFactory(org.slf4j.LoggerFactory) Function(java.util.function.Function) NiceNameUI(com.helger.pd.publisher.nicename.NiceNameUI) PDCommonUI(com.helger.pd.publisher.ui.PDCommonUI) IHCNode(com.helger.html.hc.IHCNode) ParticipantIdentifierSchemeManager(com.helger.peppolid.peppol.pidscheme.ParticipantIdentifierSchemeManager) BootstrapPageHeader(com.helger.photon.bootstrap4.utils.BootstrapPageHeader) Nonempty(com.helger.commons.annotation.Nonempty) Locale(java.util.Locale) PDServerConfiguration(com.helger.pd.indexer.settings.PDServerConfiguration) IHasID(com.helger.commons.id.IHasID) EnumHelper(com.helger.commons.lang.EnumHelper) IParticipantIdentifierScheme(com.helger.peppolid.peppol.pidscheme.IParticipantIdentifierScheme) GlobalDebug(com.helger.commons.debug.GlobalDebug) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Nonnull(javax.annotation.Nonnull) Nullable(javax.annotation.Nullable) PDTToString(com.helger.commons.datetime.PDTToString) BootstrapViewForm(com.helger.photon.bootstrap4.form.BootstrapViewForm) BootstrapTabBox(com.helger.photon.bootstrap4.nav.BootstrapTabBox) HCNodeList(com.helger.html.hc.impl.HCNodeList) PDStoredBusinessEntity(com.helger.pd.indexer.storage.PDStoredBusinessEntity) HCLI(com.helger.html.hc.html.grouping.HCLI) PDStorageManager(com.helger.pd.indexer.storage.PDStorageManager) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) Logger(org.slf4j.Logger) CommonsArrayList(com.helger.commons.collection.impl.CommonsArrayList) PeppolIdentifierFactory(com.helger.peppolid.factory.PeppolIdentifierFactory) StringHelper(com.helger.commons.string.StringHelper) AbstractAppWebPage(com.helger.pd.publisher.ui.AbstractAppWebPage) Collection(java.util.Collection) ValueEnforcer(com.helger.commons.ValueEnforcer) BootstrapCard(com.helger.photon.bootstrap4.card.BootstrapCard) PDStoredMLName(com.helger.pd.indexer.storage.PDStoredMLName) ICommonsList(com.helger.commons.collection.impl.ICommonsList) HCHR(com.helger.html.hc.html.grouping.HCHR) ICommonsMap(com.helger.commons.collection.impl.ICommonsMap) DefaultCSSClassProvider(com.helger.html.css.DefaultCSSClassProvider) ICSSClassProvider(com.helger.html.css.ICSSClassProvider) ICommonsList(com.helger.commons.collection.impl.ICommonsList) BootstrapCard(com.helger.photon.bootstrap4.card.BootstrapCard) HCNodeList(com.helger.html.hc.impl.HCNodeList) HCHR(com.helger.html.hc.html.grouping.HCHR) HCH1(com.helger.html.hc.html.sections.HCH1) PDStoredMLName(com.helger.pd.indexer.storage.PDStoredMLName) BootstrapViewForm(com.helger.photon.bootstrap4.form.BootstrapViewForm) IDocumentTypeIdentifier(com.helger.peppolid.IDocumentTypeIdentifier) BootstrapTabBox(com.helger.photon.bootstrap4.nav.BootstrapTabBox) BootstrapPageHeader(com.helger.photon.bootstrap4.utils.BootstrapPageHeader) PDStoredBusinessEntity(com.helger.pd.indexer.storage.PDStoredBusinessEntity) IParticipantIdentifierScheme(com.helger.peppolid.peppol.pidscheme.IParticipantIdentifierScheme) HCOL(com.helger.html.hc.html.grouping.HCOL) HCLI(com.helger.html.hc.html.grouping.HCLI) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) IHCNode(com.helger.html.hc.IHCNode) Nonnull(javax.annotation.Nonnull)

Aggregations

HCNodeList (com.helger.html.hc.impl.HCNodeList)82 Locale (java.util.Locale)50 Nonnull (javax.annotation.Nonnull)31 BootstrapFormGroup (com.helger.photon.bootstrap4.form.BootstrapFormGroup)27 BootstrapButtonToolbar (com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar)26 HCA (com.helger.html.hc.html.textlevel.HCA)25 HCRow (com.helger.html.hc.html.tabular.HCRow)21 BootstrapButton (com.helger.photon.bootstrap4.button.BootstrapButton)20 ISimpleURL (com.helger.commons.url.ISimpleURL)19 DTCol (com.helger.photon.uictrls.datatables.column.DTCol)19 PDTToString (com.helger.commons.datetime.PDTToString)18 HCTable (com.helger.html.hc.html.tabular.HCTable)18 BootstrapViewForm (com.helger.photon.bootstrap4.form.BootstrapViewForm)18 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)17 BootstrapDTColAction (com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDTColAction)17 ISMPServiceGroupManager (com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroupManager)16 BootstrapDataTables (com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDataTables)15 DataTables (com.helger.photon.uictrls.datatables.DataTables)14 RequestField (com.helger.photon.core.form.RequestField)13 BootstrapForm (com.helger.photon.bootstrap4.form.BootstrapForm)12