Search in sources :

Example 6 with HCCode

use of com.helger.html.hc.html.textlevel.HCCode 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 7 with HCCode

use of com.helger.html.hc.html.textlevel.HCCode in project phoss-smp by phax.

the class SMPCommonUI method getDocumentTypeIDDetails.

@Nonnull
public static HCUL getDocumentTypeIDDetails(@Nonnull final IPeppolDocumentTypeIdentifierParts aParts) {
    final HCUL aUL = new HCUL();
    aUL.addItem().addChild("Root namespace: ").addChild(new HCCode().addChild(aParts.getRootNS()));
    aUL.addItem().addChild("Local name: ").addChild(new HCCode().addChild(aParts.getLocalName()));
    aUL.addItem().addChild("Customization ID: ").addChild(new HCCode().addChild(aParts.getCustomizationID()));
    aUL.addItem().addChild("Version: ").addChild(new HCCode().addChild(aParts.getVersion()));
    return aUL;
}
Also used : HCUL(com.helger.html.hc.html.grouping.HCUL) HCCode(com.helger.html.hc.html.textlevel.HCCode) Nonnull(javax.annotation.Nonnull)

Example 8 with HCCode

use of com.helger.html.hc.html.textlevel.HCCode in project peppol-practical by phax.

the class PageSecureSMLConfiguration method showInputForm.

@Override
protected void showInputForm(@Nonnull final WebPageExecutionContext aWPEC, @Nullable final ISMLConfiguration aSelectedObject, @Nonnull final BootstrapForm aForm, final boolean bFormSubmitted, @Nonnull final EWebPageFormAction eFormAction, @Nonnull final FormErrorList aFormErrors) {
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final boolean bEdit = eFormAction.isEdit();
    aForm.addChild(getUIHandler().createActionHeader(bEdit ? "Edit SML configuration '" + aSelectedObject.getDisplayName() + "'" : "Create new SML configuration"));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("ID").setCtrl(new HCEdit(new RequestField(FIELD_ID, aSelectedObject != null ? aSelectedObject.getID() : null)).setReadOnly(bEdit)).setHelpText("The internal ID of the SML configuration. This value cannot be edited.").setErrorList(aFormErrors.getListOfField(FIELD_ID)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Name").setCtrl(new HCEdit(new RequestField(FIELD_DISPLAY_NAME, aSelectedObject != null ? aSelectedObject.getDisplayName() : null))).setHelpText("The name of the SML configuration. This is for informational purposes only and has no effect on the functionality.").setErrorList(aFormErrors.getListOfField(FIELD_DISPLAY_NAME)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("DNS Zone").setCtrl(new HCEdit(new RequestField(FIELD_DNS_ZONE, aSelectedObject != null ? aSelectedObject.getDNSZone() : null))).setHelpText(new HCTextNode("The name of the DNS Zone that this SML is working upon (e.g. "), new HCCode().addChild("sml.peppolcentral.org"), new HCTextNode("). The value will automatically converted to all-lowercase!")).setErrorList(aFormErrors.getListOfField(FIELD_DNS_ZONE)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Management Service URL").setCtrl(new HCEdit(new RequestField(FIELD_MANAGEMENT_ADDRESS_URL, aSelectedObject != null ? aSelectedObject.getManagementServiceURL() : null))).setHelpText("The service URL where the SML management application is running on including the host name. It may not contain the '" + CSMLDefault.MANAGEMENT_SERVICE_METADATA + "' or '" + CSMLDefault.MANAGEMENT_SERVICE_PARTICIPANTIDENTIFIER + "' path elements!").setErrorList(aFormErrors.getListOfField(FIELD_MANAGEMENT_ADDRESS_URL)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Client Certificate required?").setCtrl(new HCCheckBox(new RequestFieldBoolean(FIELD_CLIENT_CERTIFICATE_REQUIRED, aSelectedObject != null ? aSelectedObject.isClientCertificateRequired() : DEFAULT_CLIENT_CERTIFICATE_REQUIRED))).setHelpText("Check this if this SML requires a client certificate for access. Both Peppol production SML and SMK require a client certificate. Only a locally running SML software may not require a client certificate.").setErrorList(aFormErrors.getListOfField(FIELD_CLIENT_CERTIFICATE_REQUIRED)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("SMP API type").setCtrl(new SMPAPITypeSelect(new RequestField(FIELD_SMP_API_TYPE, aSelectedObject != null ? aSelectedObject.getSMPAPIType().getID() : null), aDisplayLocale)).setErrorList(aFormErrors.getListOfField(FIELD_SMP_API_TYPE)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("SMP identifier type").setCtrl(new SMPIdentifierTypeSelect(new RequestField(FIELD_SMP_ID_TYPE, aSelectedObject != null ? aSelectedObject.getSMPIdentifierType().getID() : null), aDisplayLocale)).setErrorList(aFormErrors.getListOfField(FIELD_SMP_ID_TYPE)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Production SML?").setCtrl(new HCCheckBox(new RequestFieldBoolean(FIELD_PRODUCTION, aSelectedObject != null ? aSelectedObject.isProduction() : true))).setHelpText("Check this if this SML is a production SML. Don't check e.g. for SMK.").setErrorList(aFormErrors.getListOfField(FIELD_PRODUCTION)));
}
Also used : Locale(java.util.Locale) HCCode(com.helger.html.hc.html.textlevel.HCCode) RequestFieldBoolean(com.helger.photon.core.form.RequestFieldBoolean) HCEdit(com.helger.html.hc.html.forms.HCEdit) HCCheckBox(com.helger.html.hc.html.forms.HCCheckBox) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) HCTextNode(com.helger.html.hc.impl.HCTextNode) SMPAPITypeSelect(com.helger.peppol.ui.select.SMPAPITypeSelect) RequestField(com.helger.photon.core.form.RequestField) SMPIdentifierTypeSelect(com.helger.peppol.ui.select.SMPIdentifierTypeSelect)

Aggregations

HCCode (com.helger.html.hc.html.textlevel.HCCode)8 Nonnull (javax.annotation.Nonnull)6 HCNodeList (com.helger.html.hc.impl.HCNodeList)5 HCTextNode (com.helger.html.hc.impl.HCTextNode)5 HCSmall (com.helger.html.hc.html.textlevel.HCSmall)3 BootstrapBadge (com.helger.photon.bootstrap4.badge.BootstrapBadge)3 HCUL (com.helger.html.hc.html.grouping.HCUL)2 Locale (java.util.Locale)2 PDTToString (com.helger.commons.datetime.PDTToString)1 ISimpleURL (com.helger.commons.url.ISimpleURL)1 IHCNode (com.helger.html.hc.IHCNode)1 HCCheckBox (com.helger.html.hc.html.forms.HCCheckBox)1 HCEdit (com.helger.html.hc.html.forms.HCEdit)1 HCDiv (com.helger.html.hc.html.grouping.HCDiv)1 HCRow (com.helger.html.hc.html.tabular.HCRow)1 HCTable (com.helger.html.hc.html.tabular.HCTable)1 HCA (com.helger.html.hc.html.textlevel.HCA)1 HCEM (com.helger.html.hc.html.textlevel.HCEM)1 SMPAPITypeSelect (com.helger.peppol.ui.select.SMPAPITypeSelect)1 SMPIdentifierTypeSelect (com.helger.peppol.ui.select.SMPIdentifierTypeSelect)1