Search in sources :

Example 6 with RequestField

use of com.helger.photon.core.form.RequestField in project phoss-smp by phax.

the class PageSecureRedirect method showInputForm.

@Override
protected void showInputForm(@Nonnull final WebPageExecutionContext aWPEC, @Nullable final ISMPRedirect aSelectedObject, @Nonnull final BootstrapForm aForm, final boolean bFormSubmitted, @Nonnull final EWebPageFormAction eFormAction, @Nonnull final FormErrorList aFormErrors) {
    final boolean bEdit = eFormAction.isEdit();
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final IIdentifierFactory aIdentifierFactory = SMPMetaManager.getIdentifierFactory();
    aForm.addChild(getUIHandler().createActionHeader(bEdit ? "Edit Redirect" : "Create new Redirect"));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Service Group").setCtrl(new HCServiceGroupSelect(new RequestField(FIELD_SERVICE_GROUP_ID, aSelectedObject != null ? aSelectedObject.getServiceGroupID() : null), aDisplayLocale).setReadOnly(bEdit)).setErrorList(aFormErrors.getListOfField(FIELD_SERVICE_GROUP_ID)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Document Type ID").setCtrl(new HCEdit(new RequestField(FIELD_DOCTYPE_ID, aSelectedObject != null ? aSelectedObject.getDocumentTypeIdentifier().getURIEncoded() : aIdentifierFactory.getDefaultDocumentTypeIdentifierScheme() + CIdentifier.URL_SCHEME_VALUE_SEPARATOR)).setReadOnly(bEdit)).setErrorList(aFormErrors.getListOfField(FIELD_DOCTYPE_ID)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Redirect To").setCtrl(new HCEdit(new RequestField(FIELD_REDIRECT_TO, aSelectedObject != null ? aSelectedObject.getTargetHref() : null))).setHelpText("URL to redirect to. Must include the service group and the document type in the URL!").setErrorList(aFormErrors.getListOfField(FIELD_REDIRECT_TO)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Subject Unique Identifier").setCtrl(new HCEdit(new RequestField(FIELD_SUBJECT_UNIQUE_IDENTIFIER, aSelectedObject != null ? aSelectedObject.getSubjectUniqueIdentifier() : null))).setHelpText("Holds the Subject Unique Identifier of the certificate of the " + "destination SMP. A client SHOULD validate that the Subject " + "Unique Identifier of the certificate used to sign the resource at the " + "destination SMP matches the Subject Unique Identifier published in " + "the redirecting SMP.").setErrorList(aFormErrors.getListOfField(FIELD_SUBJECT_UNIQUE_IDENTIFIER)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Extension").setCtrl(new HCTextArea(new RequestField(FIELD_EXTENSION, aSelectedObject != null ? aSelectedObject.getFirstExtensionXML() : null))).setHelpText("Optional extension to the service group. If present it must be valid XML content!").setErrorList(aFormErrors.getListOfField(FIELD_EXTENSION)));
}
Also used : Locale(java.util.Locale) HCServiceGroupSelect(com.helger.phoss.smp.ui.secure.hc.HCServiceGroupSelect) HCTextArea(com.helger.html.hc.html.forms.HCTextArea) HCEdit(com.helger.html.hc.html.forms.HCEdit) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) IIdentifierFactory(com.helger.peppolid.factory.IIdentifierFactory) RequestField(com.helger.photon.core.form.RequestField)

Example 7 with RequestField

use of com.helger.photon.core.form.RequestField in project phoss-smp by phax.

the class PageSecureSMLCertificateUpdate method fillContent.

@Override
protected void fillContent(@Nonnull final WebPageExecutionContext aWPEC) {
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final FormErrorList aFormErrors = new FormErrorList();
    aNodeList.addChild(info().addChildren(div("Prepare the update of your SMP certificate in the future."), div("Note: this is a custom SML extension that only works with the CEF SML instances!")));
    // check for expired certificate
    boolean bShowForm = true;
    {
        final X509Certificate aEntry = SMPKeyManager.getInstance().getPrivateKeyCertificate();
        if (aEntry != null) {
            try {
                aEntry.checkValidity();
                aNodeList.addChild(info("Your SMP certificate is still valid until " + PDTToString.getAsString(PDTFactory.createLocalDateTime(aEntry.getNotAfter()), aDisplayLocale) + "."));
            } catch (final CertificateExpiredException ex) {
                aNodeList.addChild(error("Your SMP certificate is already expired." + " This functionality works only if your SMP certificate is NOT expired yet." + " Please contact CEF-EDELIVERY-SUPPORT@ec.europa.eu with your SMP ID, the new certificate and the requested exchange date!"));
                bShowForm = false;
            } catch (final CertificateNotYetValidException ex) {
                aNodeList.addChild(warn("Your SMP certificate is not valid yet." + " For this page to work you need to have your old certificate (the one that will expire soon) configured." + " Most likely the certificate change will not work."));
            }
        }
    }
    if (aWPEC.hasAction(CPageParam.ACTION_PERFORM)) {
        if (aWPEC.hasSubAction(SUBACTION_SMP_UPDATE_CERT))
            _updateSMPCertAtSML(aWPEC, aFormErrors);
    }
    // Update SMP certificate in SML
    if (bShowForm) {
        final BootstrapForm aForm = getUIHandler().createFormFileUploadSelf(aWPEC);
        aForm.setLeft(3);
        aForm.addChild(warn("It is your responsibility to actually perform the update of the certificate in this SMP at the specified time! This does NOT happen automatically."));
        final BootstrapDateTimePicker aDTP = BootstrapDateTimePicker.create(FIELD_PM_MIGRATION_DATE, (LocalDate) null, aDisplayLocale);
        aDTP.setMinDate(PDTFactory.getCurrentLocalDate().plusDays(1));
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Certificate migration date").setCtrl(aDTP).setHelpText("The SML will replace the certificate at this date." + " It must be in the future and within the validity period of the provided new public certificate." + " If not provided, the 'valid from' part of the new certificate is used.").setErrorList(aFormErrors.getListOfField(FIELD_PM_MIGRATION_DATE)));
        aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("New public certificate").setCtrl(new HCTextArea(new RequestField(FIELD_PM_PUBLIC_CERT)).setRows(10)).setHelpText(span("Paste the public part of your new certificate here (using PEM encoding)." + " Do NOT paste your new private key here." + " Must start with ").addChild(code(CertificateHelper.BEGIN_CERTIFICATE)).addChild(" and end with ").addChild(code(CertificateHelper.END_CERTIFICATE))).setErrorList(aFormErrors.getListOfField(FIELD_PM_PUBLIC_CERT)));
        final BootstrapButtonToolbar aToolbar = aForm.addAndReturnChild(new BootstrapButtonToolbar(aWPEC));
        aToolbar.addHiddenField(CPageParam.PARAM_ACTION, CPageParam.ACTION_PERFORM);
        aToolbar.addHiddenField(CPageParam.PARAM_SUBACTION, SUBACTION_SMP_UPDATE_CERT);
        aToolbar.addSubmitButton("Prepare certificate update");
        aNodeList.addChild(aForm);
    }
}
Also used : Locale(java.util.Locale) CertificateNotYetValidException(java.security.cert.CertificateNotYetValidException) HCNodeList(com.helger.html.hc.impl.HCNodeList) CertificateExpiredException(java.security.cert.CertificateExpiredException) HCTextArea(com.helger.html.hc.html.forms.HCTextArea) FormErrorList(com.helger.photon.core.form.FormErrorList) BootstrapDateTimePicker(com.helger.photon.bootstrap4.uictrls.datetimepicker.BootstrapDateTimePicker) X509Certificate(java.security.cert.X509Certificate) BootstrapForm(com.helger.photon.bootstrap4.form.BootstrapForm) BootstrapButtonToolbar(com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) RequestField(com.helger.photon.core.form.RequestField)

Example 8 with RequestField

use of com.helger.photon.core.form.RequestField in project phoss-smp by phax.

the class PageSecureServiceGroupMigrationOutbound method showInputForm.

@Override
protected void showInputForm(@Nonnull final WebPageExecutionContext aWPEC, @Nullable final ISMPParticipantMigration aSelectedObject, @Nonnull final BootstrapForm aForm, final boolean bIsFormSubmitted, @Nonnull final EWebPageFormAction eFormAction, @Nonnull final FormErrorList aFormErrors) {
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final ISMPParticipantMigrationManager aParticipantMigrationMgr = SMPMetaManager.getParticipantMigrationMgr();
    // State is filtered below
    final ICommonsList<ISMPParticipantMigration> aExistingOutgoingMigrations = aParticipantMigrationMgr.getAllOutboundParticipantMigrations(null);
    // Get all participant identifiers for which NO new migration can be
    // initiated (because they were already migrated or migration is currently
    // in progress)
    final ICommonsSet<IParticipantIdentifier> aPIDsThatCannotBeUsed = new CommonsHashSet<>();
    aPIDsThatCannotBeUsed.addAllMapped(aExistingOutgoingMigrations, x -> x.getState().preventsNewMigration(), ISMPParticipantMigration::getParticipantIdentifier);
    // Filter out all for which it makes no sense
    final HCServiceGroupSelect aSGSelect = new HCServiceGroupSelect(new RequestField(FIELD_PARTICIPANT_ID), aDisplayLocale, x -> aPIDsThatCannotBeUsed.containsNone(y -> x.getParticipantIdentifier().hasSameContent(y)));
    if (!aSGSelect.containsAnyServiceGroup()) {
        aForm.addChild(warn("No Service Group on this SMP can currently be migrated."));
    } else {
        aForm.addChild(getUIHandler().createActionHeader("Start a Participant Migration from this SMP to another SMP"));
        aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Service Group").setCtrl(aSGSelect).setHelpText("Select the Service Group to migrate to another SMP. Each Service Group can only be migrated once from this SMP. Only Service Groups registered to the SML can be migrated.").setErrorList(aFormErrors.getListOfField(FIELD_PARTICIPANT_ID)));
    }
}
Also used : Locale(java.util.Locale) HCOL(com.helger.html.hc.html.grouping.HCOL) WebPageExecutionContext(com.helger.photon.uicore.page.WebPageExecutionContext) EDefaultIcon(com.helger.photon.uicore.icon.EDefaultIcon) ISMPSettings(com.helger.phoss.smp.settings.ISMPSettings) LoggerFactory(org.slf4j.LoggerFactory) BootstrapButtonToolbar(com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar) AbstractBootstrapWebPageActionHandlerDelete(com.helger.photon.bootstrap4.pages.handler.AbstractBootstrapWebPageActionHandlerDelete) FormErrorList(com.helger.photon.core.form.FormErrorList) BootstrapForm(com.helger.photon.bootstrap4.form.BootstrapForm) IIdentifierFactory(com.helger.peppolid.factory.IIdentifierFactory) ICommonsIterable(com.helger.commons.collection.impl.ICommonsIterable) HCServiceGroupSelect(com.helger.phoss.smp.ui.secure.hc.HCServiceGroupSelect) Nonempty(com.helger.commons.annotation.Nonempty) BootstrapDataTables(com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDataTables) Locale(java.util.Locale) HCA(com.helger.html.hc.html.textlevel.HCA) BootstrapDTColAction(com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDTColAction) CPageParam(com.helger.photon.uicore.css.CPageParam) ISMPParticipantMigrationManager(com.helger.phoss.smp.domain.pmigration.ISMPParticipantMigrationManager) SMPCommonUI(com.helger.phoss.smp.ui.SMPCommonUI) PDTToString(com.helger.commons.datetime.PDTToString) BootstrapViewForm(com.helger.photon.bootstrap4.form.BootstrapViewForm) BootstrapTabBox(com.helger.photon.bootstrap4.nav.BootstrapTabBox) IHCCell(com.helger.html.hc.html.tabular.IHCCell) EWebPageFormAction(com.helger.photon.uicore.page.EWebPageFormAction) BootstrapButton(com.helger.photon.bootstrap4.button.BootstrapButton) ICommonsList(com.helger.commons.collection.impl.ICommonsList) DTCol(com.helger.photon.uictrls.datatables.column.DTCol) ISMPServiceGroupManager(com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroupManager) ManageParticipantIdentifierServiceCaller(com.helger.peppol.smlclient.ManageParticipantIdentifierServiceCaller) ICommonsSet(com.helger.commons.collection.impl.ICommonsSet) DataTables(com.helger.photon.uictrls.datatables.DataTables) HCRow(com.helger.html.hc.html.tabular.HCRow) EValidity(com.helger.commons.state.EValidity) AbstractSMPWebPageForm(com.helger.phoss.smp.ui.AbstractSMPWebPageForm) IHCNode(com.helger.html.hc.IHCNode) EParticipantMigrationState(com.helger.phoss.smp.domain.pmigration.EParticipantMigrationState) SMPKeyManager(com.helger.phoss.smp.security.SMPKeyManager) EDTColType(com.helger.photon.uictrls.datatables.column.EDTColType) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) Nonnull(javax.annotation.Nonnull) Nullable(javax.annotation.Nullable) ISimpleURL(com.helger.commons.url.ISimpleURL) HCNodeList(com.helger.html.hc.impl.HCNodeList) BootstrapWarnBox(com.helger.photon.bootstrap4.alert.BootstrapWarnBox) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) Logger(org.slf4j.Logger) StringHelper(com.helger.commons.string.StringHelper) ISMPParticipantMigration(com.helger.phoss.smp.domain.pmigration.ISMPParticipantMigration) HCTable(com.helger.html.hc.html.tabular.HCTable) SMPMetaManager(com.helger.phoss.smp.domain.SMPMetaManager) RequestField(com.helger.photon.core.form.RequestField) CommonsHashSet(com.helger.commons.collection.impl.CommonsHashSet) SMPServerConfiguration(com.helger.phoss.smp.SMPServerConfiguration) ESortOrder(com.helger.commons.compare.ESortOrder) AbstractBootstrapWebPageActionHandlerWithQuery(com.helger.photon.bootstrap4.pages.handler.AbstractBootstrapWebPageActionHandlerWithQuery) ISMPParticipantMigration(com.helger.phoss.smp.domain.pmigration.ISMPParticipantMigration) HCServiceGroupSelect(com.helger.phoss.smp.ui.secure.hc.HCServiceGroupSelect) ISMPParticipantMigrationManager(com.helger.phoss.smp.domain.pmigration.ISMPParticipantMigrationManager) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) CommonsHashSet(com.helger.commons.collection.impl.CommonsHashSet) IParticipantIdentifier(com.helger.peppolid.IParticipantIdentifier) RequestField(com.helger.photon.core.form.RequestField)

Example 9 with RequestField

use of com.helger.photon.core.form.RequestField in project phoss-smp by phax.

the class PageSecureTransportProfiles method showInputForm.

@Override
protected void showInputForm(@Nonnull final WebPageExecutionContext aWPEC, @Nullable final ISMPTransportProfile aSelectedObject, @Nonnull final BootstrapForm aForm, final boolean bFormSubmitted, @Nonnull final EWebPageFormAction eFormAction, @Nonnull final FormErrorList aFormErrors) {
    final boolean bEdit = eFormAction.isEdit();
    aForm.addChild(getUIHandler().createActionHeader(bEdit ? "Edit transport profile '" + aSelectedObject.getID() + "'" : "Create new transport profile"));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("ID").setCtrl(new HCEdit(new RequestField(FIELD_ID, aSelectedObject != null ? aSelectedObject.getID() : null)).setReadOnly(bEdit)).setHelpText("The ID of the transport profile to be used in SMP endpoints.").setErrorList(aFormErrors.getListOfField(FIELD_ID)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Name").setCtrl(new HCEdit(new RequestField(FIELD_NAME, aSelectedObject != null ? aSelectedObject.getName() : null))).setHelpText("The name of the transport profile").setErrorList(aFormErrors.getListOfField(FIELD_NAME)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Deprecated?").setCtrl(new HCCheckBox(new RequestFieldBoolean(FIELD_DEPRECATED, aSelectedObject != null ? aSelectedObject.isDeprecated() : DEFAULT_DEPRECATED))).setHelpText("Is the transport profile deprecated?").setErrorList(aFormErrors.getListOfField(FIELD_DEPRECATED)));
}
Also used : 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) RequestField(com.helger.photon.core.form.RequestField)

Example 10 with RequestField

use of com.helger.photon.core.form.RequestField in project peppol-practical by phax.

the class PagePublicToolsIdentifierInformation method fillContent.

@Override
protected void fillContent(@Nonnull final WebPageExecutionContext aWPEC) {
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final FormErrorList aFormErrors = new FormErrorList();
    final boolean bShowInput = true;
    boolean bShowHeader = true;
    if (aWPEC.hasAction(CPageParam.ACTION_PERFORM)) {
        // Validate fields
        final String sIDType = aWPEC.params().getAsString(FIELD_ID_TYPE);
        final EIDType eIDType = EIDType.getFromIDOrNull(sIDType);
        String sIDValue = aWPEC.params().getAsStringTrimmed(FIELD_ID_VALUE);
        final boolean bDecodeValue = aWPEC.params().isCheckBoxChecked(FIELD_ID_DECODE, DEFAULT_DECODE);
        if (bDecodeValue) {
            // Try decoding - else stick with the original
            sIDValue = URLHelper.urlDecodeOrDefault(sIDValue, sIDValue);
        }
        if (StringHelper.hasNoText(sIDType))
            aFormErrors.addFieldError(FIELD_ID_TYPE, "An identifier type must be selected");
        else if (eIDType == null)
            aFormErrors.addFieldError(FIELD_ID_TYPE, "An identifier type must be selected");
        if (StringHelper.hasNoText(sIDValue))
            aFormErrors.addFieldError(FIELD_ID_VALUE, "An identifier value must be provided");
        if (aFormErrors.isEmpty()) {
            STATS_COUNT.increment();
            STATS_ID_TYPE.increment(eIDType.getID());
            bShowHeader = false;
            LOGGER.info("Checking identifier type " + eIDType.name() + " for value '" + sIDValue + "'");
            final ErrorList aIDErrors = new ErrorList();
            final ICommonsList<KVPair> aDetails = new CommonsArrayList<>();
            // Perform the main validation
            eIDType.getValidator().validate(sIDValue, aIDErrors, aDetails);
            final IHCNode aDetailsNode;
            if (aDetails.isEmpty())
                aDetailsNode = null;
            else {
                final HCUL aULDetails = new HCUL();
                for (final KVPair aPair : aDetails) aULDetails.addAndReturnItem(aPair.getKey() + ": ").addChild(aPair.hasValue() ? code(aPair.getValue()) : badgeInfo("empty string"));
                aDetailsNode = new HCNodeList().addChild(div("Determined details are:")).addChild(aULDetails);
            }
            if (aIDErrors.containsNoError()) {
                STATS_COUNT_SUCCESS.increment();
                final IHCNode aWarningsNode;
                final EBootstrapAlertType eAlertType;
                if (aIDErrors.isEmpty()) {
                    // No errors, no warnings
                    eAlertType = EBootstrapAlertType.SUCCESS;
                    aWarningsNode = null;
                } else {
                    // No errors but warnings
                    eAlertType = EBootstrapAlertType.WARNING;
                    final HCUL aUL = new HCUL();
                    for (final IError aError : aIDErrors) aUL.addItem(aError.getAsString(aDisplayLocale));
                    aWarningsNode = new HCNodeList().addChild(div("But there are some warnings:")).addChild(aUL);
                }
                aNodeList.addChild(new BootstrapBox(eAlertType).addChild(div("The identifier ").addChild(code(sIDValue)).addChild(" is valid according to the rules of '" + eIDType.getDisplayName() + "'")).addChild(aWarningsNode).addChild(aDetailsNode));
                LOGGER.info(aIDErrors.isEmpty() ? "success" : "success with warning");
            } else {
                // At least one error
                final HCUL aUL = new HCUL();
                for (final IError aError : aIDErrors) aUL.addItem(aError.getAsString(aDisplayLocale));
                aNodeList.addChild(error(div("The identifier ").addChild(code(sIDValue)).addChild(" is NOT valid according to the rules of '" + eIDType.getDisplayName() + "'")).addChild(aUL).addChild(aDetailsNode));
                LOGGER.info("failure");
            }
        }
    }
    if (bShowInput) {
        if (bShowHeader) {
            final ICommonsOrderedMap<String, String> aRuleSets = new CommonsLinkedHashMap<>();
            aRuleSets.put("Peppol Policy for use of Identifiers v" + IDENTIFIER_POLICY_VERSION, "https://docs.peppol.eu/edelivery/");
            aRuleSets.put("Peppol Participant Identifier Code List v" + EPredefinedParticipantIdentifierScheme.CODE_LIST_VERSION, "https://docs.peppol.eu/edelivery/codelists/");
            aRuleSets.put("Peppol Document Type Identifier Code List v" + EPredefinedDocumentTypeIdentifier.CODE_LIST_VERSION, "https://docs.peppol.eu/edelivery/codelists/");
            aRuleSets.put("Peppol Process Identifier Code List v" + EPredefinedProcessIdentifier.CODE_LIST_VERSION, "https://docs.peppol.eu/edelivery/codelists/");
            final HCUL aULRules = new HCUL();
            for (final Map.Entry<String, String> aEntry : aRuleSets.entrySet()) aULRules.addAndReturnItem(aEntry.getKey() + " - ").addChild(new HCA(new SimpleURL(aEntry.getValue())).setTargetBlank().addChild("see details"));
            aNodeList.addChild(info(div("This page lets you verify identifiers against official rules. Current rule sets are:")).addChild(aULRules));
        }
        final HCExtSelect aTypeSelect = new HCExtSelect(new RequestField(FIELD_ID_TYPE));
        for (final EIDType e : EIDType.values()) aTypeSelect.addOption(e.getID(), e.getDisplayName());
        aTypeSelect.addOptionPleaseSelect(aDisplayLocale);
        final BootstrapForm aForm = aNodeList.addAndReturnChild(getUIHandler().createFormSelf(aWPEC).setFormType(EBootstrapFormType.DEFAULT).setMethod(EHCFormMethod.GET).setLeft(2));
        aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Identifier type").setCtrl(aTypeSelect).setErrorList(aFormErrors.getListOfField(FIELD_ID_TYPE)));
        aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Identifier value").setCtrl(new HCEdit(new RequestField(FIELD_ID_VALUE)).setPlaceholder("scheme::value")).setHelpText(div("The identifier value to be checked for consistency. It MUST contain the scheme (like ").addChild(code(PeppolIdentifierHelper.PARTICIPANT_SCHEME_ISO6523_ACTORID_UPIS)).addChild(", ").addChild(code(PeppolIdentifierHelper.DOCUMENT_TYPE_SCHEME_BUSDOX_DOCID_QNS)).addChild(" or ").addChild(code(PeppolIdentifierHelper.PROCESS_SCHEME_CENBII_PROCID_UBL)).addChild(") AND the value as one long string")).setErrorList(aFormErrors.getListOfField(FIELD_ID_VALUE)));
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Try to URL decode the identifier value?").setCtrl(new HCCheckBox(new RequestFieldBoolean(FIELD_ID_DECODE, DEFAULT_DECODE))).setErrorList(aFormErrors.getListOfField(FIELD_ID_DECODE)));
        final BootstrapButtonToolbar aToolbar = aForm.addAndReturnChild(new BootstrapButtonToolbar(aWPEC));
        aToolbar.addHiddenField(CPageParam.PARAM_ACTION, CPageParam.ACTION_PERFORM);
        aToolbar.addSubmitButton("Check identifier");
    }
}
Also used : Locale(java.util.Locale) BootstrapBox(com.helger.photon.bootstrap4.alert.BootstrapBox) HCExtSelect(com.helger.photon.uicore.html.select.HCExtSelect) HCNodeList(com.helger.html.hc.impl.HCNodeList) EBootstrapAlertType(com.helger.photon.bootstrap4.alert.EBootstrapAlertType) RequestFieldBoolean(com.helger.photon.core.form.RequestFieldBoolean) FormErrorList(com.helger.photon.core.form.FormErrorList) HCEdit(com.helger.html.hc.html.forms.HCEdit) BootstrapButtonToolbar(com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar) RequestField(com.helger.photon.core.form.RequestField) CommonsLinkedHashMap(com.helger.commons.collection.impl.CommonsLinkedHashMap) HCA(com.helger.html.hc.html.textlevel.HCA) IError(com.helger.commons.error.IError) SimpleURL(com.helger.commons.url.SimpleURL) BootstrapForm(com.helger.photon.bootstrap4.form.BootstrapForm) HCUL(com.helger.html.hc.html.grouping.HCUL) ErrorList(com.helger.commons.error.list.ErrorList) FormErrorList(com.helger.photon.core.form.FormErrorList) KVPair(com.helger.peppol.domain.KVPair) HCCheckBox(com.helger.html.hc.html.forms.HCCheckBox) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) Map(java.util.Map) ICommonsOrderedMap(com.helger.commons.collection.impl.ICommonsOrderedMap) CommonsLinkedHashMap(com.helger.commons.collection.impl.CommonsLinkedHashMap) CommonsArrayList(com.helger.commons.collection.impl.CommonsArrayList) EIDType(com.helger.peppol.domain.EIDType) IHCNode(com.helger.html.hc.IHCNode)

Aggregations

RequestField (com.helger.photon.core.form.RequestField)40 BootstrapFormGroup (com.helger.photon.bootstrap4.form.BootstrapFormGroup)37 HCEdit (com.helger.html.hc.html.forms.HCEdit)34 Locale (java.util.Locale)29 BootstrapForm (com.helger.photon.bootstrap4.form.BootstrapForm)24 HCNodeList (com.helger.html.hc.impl.HCNodeList)23 BootstrapButtonToolbar (com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar)20 FormErrorList (com.helger.photon.core.form.FormErrorList)18 HCCheckBox (com.helger.html.hc.html.forms.HCCheckBox)12 IIdentifierFactory (com.helger.peppolid.factory.IIdentifierFactory)12 PDTToString (com.helger.commons.datetime.PDTToString)11 RequestFieldBoolean (com.helger.photon.core.form.RequestFieldBoolean)10 HCTextArea (com.helger.html.hc.html.forms.HCTextArea)9 Nonnull (javax.annotation.Nonnull)9 HCA (com.helger.html.hc.html.textlevel.HCA)8 BootstrapButton (com.helger.photon.bootstrap4.button.BootstrapButton)8 HCRow (com.helger.html.hc.html.tabular.HCRow)7 HCTextNode (com.helger.html.hc.impl.HCTextNode)7 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)7 ICommonsList (com.helger.commons.collection.impl.ICommonsList)6