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);
}
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);
}
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);
}
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);
}
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())));
}
}
Aggregations