Search in sources :

Example 11 with BootstrapViewForm

use of com.helger.photon.bootstrap4.form.BootstrapViewForm 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)

Example 12 with BootstrapViewForm

use of com.helger.photon.bootstrap4.form.BootstrapViewForm in project phoss-smp by phax.

the class PageSecureRedirect method showSelectedObject.

@Override
protected void showSelectedObject(@Nonnull final WebPageExecutionContext aWPEC, @Nonnull final ISMPRedirect aSelectedObject) {
    final HCNodeList aNodeList = aWPEC.getNodeList();
    aNodeList.addChild(getUIHandler().createActionHeader("Show details of Redirect"));
    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())));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Document type ID").setCtrl(NiceNameUI.getDocumentTypeID(aSelectedObject.getDocumentTypeIdentifier(), true)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Target URL").setCtrl(HCA.createLinkedWebsite(aSelectedObject.getTargetHref(), HC_Target.BLANK)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Subject unique identifier").setCtrl(aSelectedObject.getSubjectUniqueIdentifier()));
    if (aSelectedObject.extensions().isNotEmpty())
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Extension").setCtrl(SMPCommonUI.getExtensionDisplay(aSelectedObject)));
    aNodeList.addChild(aForm);
}
Also used : HCNodeList(com.helger.html.hc.impl.HCNodeList) HCA(com.helger.html.hc.html.textlevel.HCA) BootstrapViewForm(com.helger.photon.bootstrap4.form.BootstrapViewForm) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup)

Example 13 with BootstrapViewForm

use of com.helger.photon.bootstrap4.form.BootstrapViewForm in project phoss-smp by phax.

the class PageSecureSMLConfiguration method showSelectedObject.

@Override
protected void showSelectedObject(@Nonnull final WebPageExecutionContext aWPEC, @Nonnull final ISMLInfo aSelectedObject) {
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final HCNodeList aNodeList = aWPEC.getNodeList();
    aNodeList.addChild(getUIHandler().createActionHeader("Show details of SML configuration '" + aSelectedObject.getDisplayName() + "'"));
    final BootstrapViewForm aForm = new BootstrapViewForm();
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Name").setCtrl(aSelectedObject.getDisplayName()));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("DNS Zone").setCtrl(aSelectedObject.getDNSZone()));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Publisher DNS Zone").setCtrl(aSelectedObject.getPublisherDNSZone()));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Management Service URL").setCtrl(HCA.createLinkedWebsite(aSelectedObject.getManagementServiceURL())));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Manage Service Metadata Endpoint").setCtrl(HCA.createLinkedWebsite(aSelectedObject.getManageServiceMetaDataEndpointAddress().toExternalForm())));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Manage Participant Identifier Endpoint").setCtrl(HCA.createLinkedWebsite(aSelectedObject.getManageParticipantIdentifierEndpointAddress().toExternalForm())));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Client certificate required?").setCtrl(EPhotonCoreText.getYesOrNo(aSelectedObject.isClientCertificateRequired(), aDisplayLocale)));
    aNodeList.addChild(aForm);
}
Also used : Locale(java.util.Locale) HCNodeList(com.helger.html.hc.impl.HCNodeList) BootstrapViewForm(com.helger.photon.bootstrap4.form.BootstrapViewForm) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup)

Example 14 with BootstrapViewForm

use of com.helger.photon.bootstrap4.form.BootstrapViewForm in project phoss-smp by phax.

the class PageSecureTransportProfiles method showSelectedObject.

@Override
protected void showSelectedObject(@Nonnull final WebPageExecutionContext aWPEC, @Nonnull final ISMPTransportProfile aSelectedObject) {
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    aNodeList.addChild(getUIHandler().createActionHeader("Show details of transport profile '" + aSelectedObject.getID() + "'"));
    final BootstrapViewForm aForm = new BootstrapViewForm();
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("ID").setCtrl(aSelectedObject.getID()));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Name").setCtrl(aSelectedObject.getName()));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Deprecated?").setCtrl(EPhotonCoreText.getYesOrNo(aSelectedObject.isDeprecated(), aDisplayLocale)));
    aNodeList.addChild(aForm);
}
Also used : Locale(java.util.Locale) HCNodeList(com.helger.html.hc.impl.HCNodeList) BootstrapViewForm(com.helger.photon.bootstrap4.form.BootstrapViewForm) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup)

Example 15 with BootstrapViewForm

use of com.helger.photon.bootstrap4.form.BootstrapViewForm in project phoss-smp by phax.

the class PageSecureSMPSettings method showObject.

@Override
protected void showObject(@Nonnull final WebPageExecutionContext aWPEC, @Nonnull final ISMPSettings aObject) {
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final String sDirectoryName = SMPWebAppConfiguration.getDirectoryName();
    {
        final BootstrapCard aCard = aNodeList.addAndReturnChild(new BootstrapCard());
        aCard.createAndAddHeader().addChild("REST API");
        final BootstrapCardBody aCardBody = aCard.createAndAddBody();
        final BootstrapViewForm aTable = aCardBody.addAndReturnChild(new BootstrapViewForm());
        aTable.setLeft(4);
        aTable.addFormGroup(new BootstrapFormGroup().setLabel("REST writable API disabled?").setCtrl(EPhotonCoreText.getYesOrNo(aObject.isRESTWritableAPIDisabled(), aDisplayLocale)));
    }
    {
        final BootstrapCard aCard = aNodeList.addAndReturnChild(new BootstrapCard());
        aCard.createAndAddHeader().addChild("SMK/SML");
        final BootstrapCardBody aCardBody = aCard.createAndAddBody();
        final BootstrapViewForm aTable = aCardBody.addAndReturnChild(new BootstrapViewForm());
        aTable.setLeft(4);
        aTable.addFormGroup(new BootstrapFormGroup().setLabel("SML connection required?").setCtrl(EPhotonCoreText.getYesOrNo(aObject.isSMLRequired(), aDisplayLocale)));
        aTable.addFormGroup(new BootstrapFormGroup().setLabel("SML connection enabled?").setCtrl(EPhotonCoreText.getYesOrNo(aObject.isSMLEnabled(), aDisplayLocale)));
        final ISMLInfo aSMLInfo = aObject.getSMLInfo();
        aTable.addFormGroup(new BootstrapFormGroup().setLabel("SML to be used").setCtrl(aSMLInfo == null ? em("none") : HCSMLSelect.getDisplayNameNode(aSMLInfo)));
    }
    {
        final BootstrapCard aCard = aNodeList.addAndReturnChild(new BootstrapCard());
        aCard.createAndAddHeader().addChild(sDirectoryName);
        final BootstrapCardBody aCardBody = aCard.createAndAddBody();
        final BootstrapViewForm aTable = aCardBody.addAndReturnChild(new BootstrapViewForm());
        aTable.setLeft(4);
        aTable.addFormGroup(new BootstrapFormGroup().setLabel(sDirectoryName + " integration required?").setCtrl(EPhotonCoreText.getYesOrNo(aObject.isDirectoryIntegrationRequired(), aDisplayLocale)));
        aTable.addFormGroup(new BootstrapFormGroup().setLabel(sDirectoryName + " integration enabled?").setCtrl(EPhotonCoreText.getYesOrNo(aObject.isDirectoryIntegrationEnabled(), aDisplayLocale)));
        aTable.addFormGroup(new BootstrapFormGroup().setLabel(sDirectoryName + " integration automatic update?").setCtrl(EPhotonCoreText.getYesOrNo(aObject.isDirectoryIntegrationAutoUpdate(), aDisplayLocale)));
        aTable.addFormGroup(new BootstrapFormGroup().setLabel(sDirectoryName + " hostname").setCtrl(HCA.createLinkedWebsite(aObject.getDirectoryHostName())));
    }
}
Also used : Locale(java.util.Locale) BootstrapCard(com.helger.photon.bootstrap4.card.BootstrapCard) HCNodeList(com.helger.html.hc.impl.HCNodeList) ISMLInfo(com.helger.peppol.sml.ISMLInfo) BootstrapCardBody(com.helger.photon.bootstrap4.card.BootstrapCardBody) BootstrapViewForm(com.helger.photon.bootstrap4.form.BootstrapViewForm) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup)

Aggregations

HCNodeList (com.helger.html.hc.impl.HCNodeList)16 BootstrapFormGroup (com.helger.photon.bootstrap4.form.BootstrapFormGroup)16 BootstrapViewForm (com.helger.photon.bootstrap4.form.BootstrapViewForm)16 Locale (java.util.Locale)15 HCA (com.helger.html.hc.html.textlevel.HCA)6 PDTToString (com.helger.commons.datetime.PDTToString)5 BootstrapCard (com.helger.photon.bootstrap4.card.BootstrapCard)4 Nonnull (javax.annotation.Nonnull)4 IHCNode (com.helger.html.hc.IHCNode)3 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)3 SMPBusinessCardEntity (com.helger.phoss.smp.domain.businesscard.SMPBusinessCardEntity)3 BootstrapTable (com.helger.photon.bootstrap4.table.BootstrapTable)3 Nonempty (com.helger.commons.annotation.Nonempty)2 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)2 ICommonsList (com.helger.commons.collection.impl.ICommonsList)2 ICommonsMap (com.helger.commons.collection.impl.ICommonsMap)2 PDTFromString (com.helger.commons.datetime.PDTFromString)2 StringHelper (com.helger.commons.string.StringHelper)2 HCDiv (com.helger.html.hc.html.grouping.HCDiv)2 HCOL (com.helger.html.hc.html.grouping.HCOL)2