Search in sources :

Example 76 with HCNodeList

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

the class NiceNameUI method _getWBRList.

@Nonnull
private static IHCNode _getWBRList(@Nonnull final String s) {
    final HCNodeList ret = new HCNodeList();
    String sRest = s;
    final int nChars = 10;
    while (sRest.length() > nChars) {
        ret.addChild(sRest.substring(0, nChars)).addChild(new HCWBR());
        sRest = sRest.substring(nChars);
    }
    if (sRest.length() > 0)
        ret.addChild(sRest);
    return ret;
}
Also used : HCNodeList(com.helger.html.hc.impl.HCNodeList) HCWBR(com.helger.html.hc.html.textlevel.HCWBR) Nonnull(javax.annotation.Nonnull)

Example 77 with HCNodeList

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

the class NiceNameUI method _createFormattedID.

@Nonnull
private static IHCNode _createFormattedID(@Nonnull final String sID, @Nullable final String sName, @Nullable final EBootstrapBadgeType eType, final boolean bIsDeprecated, final boolean bInDetails) {
    if (sName == null) {
        // No nice name present
        if (bInDetails)
            return new HCCode().addChild(sID);
        return new HCTextNode(sID);
    }
    final HCNodeList ret = new HCNodeList();
    ret.addChild(new BootstrapBadge(eType).addChild(sName));
    if (bIsDeprecated) {
        ret.addChild(" ").addChild(new BootstrapBadge(EBootstrapBadgeType.WARNING).addChild("Identifier is deprecated"));
    }
    if (bInDetails) {
        ret.addChild(new HCSmall().addChild(" (").addChild(new HCCode().addChild(sID)).addChild(")"));
    }
    return ret;
}
Also used : HCNodeList(com.helger.html.hc.impl.HCNodeList) BootstrapBadge(com.helger.photon.bootstrap4.badge.BootstrapBadge) HCCode(com.helger.html.hc.html.textlevel.HCCode) HCSmall(com.helger.html.hc.html.textlevel.HCSmall) HCTextNode(com.helger.html.hc.impl.HCTextNode) Nonnull(javax.annotation.Nonnull)

Example 78 with HCNodeList

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

the class NiceNameUI method createFormattedID.

@Nonnull
private static IHCNode createFormattedID(@Nonnull final String sID, @Nullable final String sName, @Nullable final EBootstrapBadgeType eType, final boolean bIsDeprecated, final boolean bInDetails) {
    if (sName == null) {
        // No nice name present
        if (bInDetails)
            return new HCCode().addChild(sID);
        return new HCTextNode(sID);
    }
    final HCNodeList ret = new HCNodeList();
    ret.addChild(new BootstrapBadge(eType).addChild(sName));
    if (bIsDeprecated) {
        ret.addChild(" ").addChild(new BootstrapBadge(EBootstrapBadgeType.WARNING).addChild("Identifier is deprecated"));
    }
    if (bInDetails) {
        ret.addChild(new HCSmall().addChild(" (").addChild(new HCCode().addChild(sID)).addChild(")"));
    }
    return ret;
}
Also used : HCNodeList(com.helger.html.hc.impl.HCNodeList) BootstrapBadge(com.helger.photon.bootstrap4.badge.BootstrapBadge) HCCode(com.helger.html.hc.html.textlevel.HCCode) HCSmall(com.helger.html.hc.html.textlevel.HCSmall) HCTextNode(com.helger.html.hc.impl.HCTextNode) Nonnull(javax.annotation.Nonnull)

Example 79 with HCNodeList

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

the class NiceNameUI method _getWBRList.

@Nonnull
private static IHCNode _getWBRList(@Nonnull final String s) {
    final HCNodeList ret = new HCNodeList();
    String sRest = s;
    final int nChars = 10;
    while (sRest.length() > nChars) {
        ret.addChild(sRest.substring(0, nChars)).addChild(new HCWBR());
        sRest = sRest.substring(nChars);
    }
    if (sRest.length() > 0)
        ret.addChild(sRest);
    return ret;
}
Also used : HCNodeList(com.helger.html.hc.impl.HCNodeList) HCWBR(com.helger.html.hc.html.textlevel.HCWBR) Nonnull(javax.annotation.Nonnull)

Example 80 with HCNodeList

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

the class AbstractPageSecureEndpoint method showSelectedObject.

@Override
protected void showSelectedObject(@Nonnull final WebPageExecutionContext aWPEC, @Nonnull final ISMPServiceInformation aSelectedObject) {
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final IDocumentTypeIdentifier aDocumentTypeID = aSelectedObject.getDocumentTypeIdentifier();
    final ISMPProcess aSelectedProcess = aWPEC.getRequestScope().attrs().getCastedValue(REQUEST_ATTR_PROCESS);
    final ISMPEndpoint aSelectedEndpoint = aWPEC.getRequestScope().attrs().getCastedValue(REQUEST_ATTR_ENDPOINT);
    final LocalDateTime aNowLDT = PDTFactory.getCurrentLocalDateTime();
    aNodeList.addChild(getUIHandler().createActionHeader("Show details of endpoint"));
    final BootstrapViewForm aForm = new BootstrapViewForm();
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Service group").setCtrl(new HCA(createViewURL(aWPEC, CMenuSecure.MENU_SERVICE_GROUPS, aSelectedObject.getServiceGroup())).addChild(aSelectedObject.getServiceGroupID())));
    // Document type identifier
    {
        final HCNodeList aCtrl = new HCNodeList();
        aCtrl.addChild(div(NiceNameUI.getDocumentTypeID(aDocumentTypeID, true)));
        try {
            final IPeppolDocumentTypeIdentifierParts aParts = PeppolDocumentTypeIdentifierParts.extractFromIdentifier(aDocumentTypeID);
            aCtrl.addChild(SMPCommonUI.getDocumentTypeIDDetails(aParts));
        } catch (final IllegalArgumentException ex) {
            if (false)
                aCtrl.addChild(error("Failed to parse document type identifier: " + ex.getMessage()));
        }
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Document type ID").setCtrl(aCtrl));
    }
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Process ID").setCtrl(NiceNameUI.getProcessID(aSelectedObject.getDocumentTypeIdentifier(), aSelectedProcess.getProcessIdentifier(), true)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Transport profile").setCtrl(new HCA(createViewURL(aWPEC, CMenuSecure.MENU_TRANSPORT_PROFILES, aSelectedEndpoint.getTransportProfile())).addChild(NiceNameUI.getTransportProfile(aSelectedEndpoint.getTransportProfile(), true))));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Endpoint reference").setCtrl(StringHelper.hasText(aSelectedEndpoint.getEndpointReference()) ? HCA.createLinkedWebsite(aSelectedEndpoint.getEndpointReference(), HC_Target.BLANK) : em("none")));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Requires business level signature").setCtrl(EPhotonCoreText.getYesOrNo(aSelectedEndpoint.isRequireBusinessLevelSignature(), aDisplayLocale)));
    if (aSelectedEndpoint.hasMinimumAuthenticationLevel())
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Minimum authentication level").setCtrl(aSelectedEndpoint.getMinimumAuthenticationLevel()));
    if (aSelectedEndpoint.hasServiceActivationDateTime()) {
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Not before").setCtrl(PDTToString.getAsString(aSelectedEndpoint.getServiceActivationDateTime(), aDisplayLocale)));
    }
    if (aSelectedEndpoint.hasServiceExpirationDateTime()) {
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Not after").setCtrl(PDTToString.getAsString(aSelectedEndpoint.getServiceExpirationDateTime(), aDisplayLocale)));
    }
    if (aSelectedEndpoint.hasCertificate()) {
        final X509Certificate aEndpointCert = CertificateHelper.convertStringToCertficateOrNull(aSelectedEndpoint.getCertificate());
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Certificate").setCtrl(aEndpointCert == null ? strong("!!!FAILED TO INTERPRETE!!!") : SMPCommonUI.createCertificateDetailsTable(null, aEndpointCert, aNowLDT, aDisplayLocale).setResponsive(true)));
    }
    if (aSelectedEndpoint.hasServiceDescription())
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Service description").setCtrl(aSelectedEndpoint.getServiceDescription()));
    if (aSelectedEndpoint.hasTechnicalContactUrl())
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Technical contact").setCtrl(HCA_MailTo.createLinkedEmail(aSelectedEndpoint.getTechnicalContactUrl())));
    if (aSelectedEndpoint.hasTechnicalInformationUrl())
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Technical information").setCtrl(HCA.createLinkedWebsite(aSelectedEndpoint.getTechnicalInformationUrl(), HC_Target.BLANK)));
    if (aSelectedEndpoint.extensions().isNotEmpty())
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Extension").setCtrl(SMPCommonUI.getExtensionDisplay(aSelectedEndpoint)));
    aNodeList.addChild(aForm);
}
Also used : Locale(java.util.Locale) LocalDateTime(java.time.LocalDateTime) IPeppolDocumentTypeIdentifierParts(com.helger.peppolid.peppol.doctype.IPeppolDocumentTypeIdentifierParts) HCNodeList(com.helger.html.hc.impl.HCNodeList) HCA(com.helger.html.hc.html.textlevel.HCA) BootstrapViewForm(com.helger.photon.bootstrap4.form.BootstrapViewForm) IDocumentTypeIdentifier(com.helger.peppolid.IDocumentTypeIdentifier) ISMPEndpoint(com.helger.phoss.smp.domain.serviceinfo.ISMPEndpoint) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) ISMPProcess(com.helger.phoss.smp.domain.serviceinfo.ISMPProcess) X509Certificate(java.security.cert.X509Certificate)

Aggregations

HCNodeList (com.helger.html.hc.impl.HCNodeList)123 Locale (java.util.Locale)74 BootstrapFormGroup (com.helger.photon.bootstrap4.form.BootstrapFormGroup)42 Nonnull (javax.annotation.Nonnull)41 BootstrapButtonToolbar (com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar)40 HCA (com.helger.html.hc.html.textlevel.HCA)35 PDTToString (com.helger.commons.datetime.PDTToString)28 ISimpleURL (com.helger.commons.url.ISimpleURL)27 HCRow (com.helger.html.hc.html.tabular.HCRow)26 BootstrapButton (com.helger.photon.bootstrap4.button.BootstrapButton)24 RequestField (com.helger.photon.core.form.RequestField)24 DTCol (com.helger.photon.uictrls.datatables.column.DTCol)24 HCTable (com.helger.html.hc.html.tabular.HCTable)23 BootstrapViewForm (com.helger.photon.bootstrap4.form.BootstrapViewForm)23 BootstrapForm (com.helger.photon.bootstrap4.form.BootstrapForm)21 BootstrapDTColAction (com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDTColAction)21 FormErrorList (com.helger.photon.core.form.FormErrorList)21 BootstrapDataTables (com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDataTables)20 HCTextNode (com.helger.html.hc.impl.HCTextNode)19 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)19