Search in sources :

Example 36 with BootstrapFormGroup

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

the class PageSecureServiceGroup method showInputForm.

@Override
protected void showInputForm(@Nonnull final WebPageExecutionContext aWPEC, @Nullable final ISMPServiceGroup 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();
    final IIdentifierFactory aIdentifierFactory = SMPMetaManager.getIdentifierFactory();
    aForm.setLeft(2);
    aForm.addChild(getUIHandler().createActionHeader(bEdit ? "Edit service group '" + aSelectedObject.getID() + "'" : "Create new service group"));
    {
        final String sDefaultScheme = aIdentifierFactory.getDefaultParticipantIdentifierScheme();
        final BootstrapRow aRow = new BootstrapRow();
        aRow.createColumn(GS_IDENTIFIER_SCHEME).addChild(new HCEdit(new RequestField(FIELD_PARTICIPANT_ID_SCHEME, aSelectedObject != null ? aSelectedObject.getParticipantIdentifier().getScheme() : sDefaultScheme)).setPlaceholder("Identifier scheme").setReadOnly(bEdit));
        aRow.createColumn(GS_IDENTIFIER_VALUE).addChild(new HCEdit(new RequestField(FIELD_PARTICIPANT_ID_VALUE, aSelectedObject != null ? aSelectedObject.getParticipantIdentifier().getValue() : null)).setPlaceholder("Identifier value").setReadOnly(bEdit));
        aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Participant ID").setCtrl(aRow).setHelpText("The participant identifier for which the service group should be created. The left part is the identifier scheme" + (sDefaultScheme == null ? "" : " (default: " + sDefaultScheme + ")") + ", the right part is the identifier value (e.g. 9915:test)").setErrorList(aFormErrors.getListOfFields(FIELD_PARTICIPANT_ID_SCHEME, FIELD_PARTICIPANT_ID_VALUE)));
    }
    aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Owning User").setCtrl(new HCUserSelect(new RequestField(FIELD_OWNING_USER_ID, aSelectedObject != null ? aSelectedObject.getOwnerID() : LoggedInUserManager.getInstance().getCurrentUserID()), aDisplayLocale)).setHelpText("The user who owns this entry. Only this user can make changes via the REST API.").setErrorList(aFormErrors.getListOfField(FIELD_OWNING_USER_ID)));
    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) HCUserSelect(com.helger.phoss.smp.ui.secure.hc.HCUserSelect) BootstrapRow(com.helger.photon.bootstrap4.grid.BootstrapRow) 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 37 with BootstrapFormGroup

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

the class PageSecureServiceGroupMigrationInbound method showSelectedObject.

@Override
protected void showSelectedObject(@Nonnull final WebPageExecutionContext aWPEC, @Nonnull final ISMPParticipantMigration aSelectedObject) {
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    aNodeList.addChild(getUIHandler().createActionHeader("Show details of inbound Participant Migration"));
    final BootstrapViewForm aForm = new BootstrapViewForm();
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Service Group").setCtrl(new HCA(createViewURL(aWPEC, CMenuSecure.MENU_SERVICE_GROUPS, aSelectedObject.getParticipantIdentifier().getURIEncoded())).addChild(aSelectedObject.getParticipantIdentifier().getURIEncoded())));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Migration state").setCtrl(aSelectedObject.getState().getDisplayName()));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Initiation datetime").setCtrl(PDTToString.getAsString(aSelectedObject.getInitiationDateTime(), aDisplayLocale)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Migration Key").setCtrl(code(aSelectedObject.getMigrationKey())));
    aNodeList.addChild(aForm);
}
Also used : Locale(java.util.Locale) 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)

Aggregations

BootstrapFormGroup (com.helger.photon.bootstrap4.form.BootstrapFormGroup)37 Locale (java.util.Locale)31 HCNodeList (com.helger.html.hc.impl.HCNodeList)27 RequestField (com.helger.photon.core.form.RequestField)22 BootstrapViewForm (com.helger.photon.bootstrap4.form.BootstrapViewForm)18 HCEdit (com.helger.html.hc.html.forms.HCEdit)17 BootstrapForm (com.helger.photon.bootstrap4.form.BootstrapForm)14 BootstrapButtonToolbar (com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar)13 FormErrorList (com.helger.photon.core.form.FormErrorList)12 HCA (com.helger.html.hc.html.textlevel.HCA)11 IIdentifierFactory (com.helger.peppolid.factory.IIdentifierFactory)11 PDTToString (com.helger.commons.datetime.PDTToString)10 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)9 HCTextArea (com.helger.html.hc.html.forms.HCTextArea)8 Nonnull (javax.annotation.Nonnull)8 ICommonsList (com.helger.commons.collection.impl.ICommonsList)6 HCCheckBox (com.helger.html.hc.html.forms.HCCheckBox)6 HCRow (com.helger.html.hc.html.tabular.HCRow)6 BootstrapCard (com.helger.photon.bootstrap4.card.BootstrapCard)6 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)5