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