Search in sources :

Example 21 with BootstrapButtonToolbar

use of com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar in project phoss-directory by phax.

the class PageSecureParticipantCount method fillContent.

@Override
protected void fillContent(@Nonnull final WebPageExecutionContext aWPEC) {
    final IRequestWebScopeWithoutResponse aRequestScope = aWPEC.getRequestScope();
    final HCNodeList aNodeList = aWPEC.getNodeList();
    {
        final BootstrapButtonToolbar aToolbar = new BootstrapButtonToolbar(aWPEC);
        aToolbar.addButton("Refresh", aWPEC.getSelfHref(), EDefaultIcon.MAGNIFIER);
        aToolbar.addButton("Delete deleted", AJAX_DELETE_DELETED.getInvocationURL(aRequestScope), EDefaultIcon.DELETE);
        aNodeList.addChild(aToolbar);
    }
    final int nNotDeletedCount = PDMetaManager.getStorageMgr().getContainedParticipantCount(EQueryMode.NON_DELETED_ONLY);
    aNodeList.addChild(h3(nNotDeletedCount + " participants (entities) are contained"));
    final int nDeletedCount = PDMetaManager.getStorageMgr().getContainedParticipantCount(EQueryMode.DELETED_ONLY);
    aNodeList.addChild(h3(nDeletedCount + " deleted participants (entities) are contained"));
    final int nReIndexCount = PDMetaManager.getIndexerMgr().getReIndexList().getItemCount();
    aNodeList.addChild(h3(nReIndexCount + " re-index items are contained"));
    final int nDeadCount = PDMetaManager.getIndexerMgr().getDeadList().getItemCount();
    aNodeList.addChild(h3(nDeadCount + " dead items are contained"));
    if (false)
        try {
            final Collector aCollector = new AllDocumentsCollector(PDMetaManager.getLucene(), (aDoc, nIdx) -> {
                final BootstrapTable aTable = new BootstrapTable();
                for (final IndexableField f : aDoc.getFields()) aTable.addBodyRow().addCells(f.name(), f.fieldType().toString(), f.stringValue());
                aNodeList.addChild(aTable);
                aNodeList.addChild(new HCHR());
            });
            PDMetaManager.getStorageMgr().searchAtomic(new MatchAllDocsQuery(), aCollector);
        } catch (final IOException ex) {
        }
}
Also used : IRequestWebScopeWithoutResponse(com.helger.web.scope.IRequestWebScopeWithoutResponse) WebPageExecutionContext(com.helger.photon.uicore.page.WebPageExecutionContext) AbstractAppWebPage(com.helger.pd.publisher.ui.AbstractAppWebPage) EDefaultIcon(com.helger.photon.uicore.icon.EDefaultIcon) IndexableField(org.apache.lucene.index.IndexableField) PDMetaManager(com.helger.pd.indexer.mgr.PDMetaManager) IOException(java.io.IOException) Collector(org.apache.lucene.search.Collector) MatchAllDocsQuery(org.apache.lucene.search.MatchAllDocsQuery) BootstrapButtonToolbar(com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar) AjaxFunctionDeclaration(com.helger.photon.ajax.decl.AjaxFunctionDeclaration) BootstrapTable(com.helger.photon.bootstrap4.table.BootstrapTable) EQueryMode(com.helger.pd.indexer.storage.EQueryMode) Nonempty(com.helger.commons.annotation.Nonempty) HCHR(com.helger.html.hc.html.grouping.HCHR) AllDocumentsCollector(com.helger.pd.indexer.lucene.AllDocumentsCollector) Nonnull(javax.annotation.Nonnull) HCNodeList(com.helger.html.hc.impl.HCNodeList) IndexableField(org.apache.lucene.index.IndexableField) IRequestWebScopeWithoutResponse(com.helger.web.scope.IRequestWebScopeWithoutResponse) HCNodeList(com.helger.html.hc.impl.HCNodeList) BootstrapTable(com.helger.photon.bootstrap4.table.BootstrapTable) HCHR(com.helger.html.hc.html.grouping.HCHR) Collector(org.apache.lucene.search.Collector) AllDocumentsCollector(com.helger.pd.indexer.lucene.AllDocumentsCollector) AllDocumentsCollector(com.helger.pd.indexer.lucene.AllDocumentsCollector) BootstrapButtonToolbar(com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar) IOException(java.io.IOException) MatchAllDocsQuery(org.apache.lucene.search.MatchAllDocsQuery)

Example 22 with BootstrapButtonToolbar

use of com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar in project phoss-directory by phax.

the class AppCommonUI method createViewLoginForm.

@Nonnull
public static BootstrapForm createViewLoginForm(@Nonnull final LayoutExecutionContext aLEC, @Nullable final String sPreselectedUserName) {
    final Locale aDisplayLocale = aLEC.getDisplayLocale();
    final IRequestWebScopeWithoutResponse aRequestScope = aLEC.getRequestScope();
    // Use new IDs for both fields, in case the login stuff is displayed more
    // than once!
    final String sIDUserName = GlobalIDFactory.getNewStringID();
    final String sIDPassword = GlobalIDFactory.getNewStringID();
    final String sIDErrorField = GlobalIDFactory.getNewStringID();
    final BootstrapForm aForm = new BootstrapForm(aLEC).setAction(aLEC.getSelfHref()).setFormType(EBootstrapFormType.DEFAULT);
    aForm.setLeft(3);
    // User name field
    aForm.addFormGroup(new BootstrapFormGroup().setLabel(EPhotonCoreText.EMAIL_ADDRESS.getDisplayText(aDisplayLocale)).setCtrl(new HCEdit(new RequestField(CLogin.REQUEST_ATTR_USERID, sPreselectedUserName)).setID(sIDUserName)));
    // Password field
    aForm.addFormGroup(new BootstrapFormGroup().setLabel(EPhotonCoreText.LOGIN_FIELD_PASSWORD.getDisplayText(aDisplayLocale)).setCtrl(new HCEditPassword(CLogin.REQUEST_ATTR_PASSWORD).setID(sIDPassword)));
    // Placeholder for error message
    aForm.addChild(new HCDiv().setID(sIDErrorField).addStyle(CCSSProperties.MARGIN.newValue("4px 0")));
    // Login button
    final BootstrapButtonToolbar aToolbar = aForm.addAndReturnChild(new BootstrapButtonToolbar(aLEC));
    final JSPackage aOnClick = new JSPackage();
    {
        final JSAnonymousFunction aJSSuccess = new JSAnonymousFunction();
        final JSVar aJSData = aJSSuccess.param("data");
        aJSSuccess.body()._if(aJSData.ref(AjaxExecutorPublicLogin.JSON_LOGGEDIN), JSHtml.windowLocationReload(), JQuery.idRef(sIDErrorField).empty().append(aJSData.ref(AjaxExecutorPublicLogin.JSON_HTML)));
        aOnClick.add(new JQueryAjaxBuilder().url(CAjax.LOGIN.getInvocationURI(aRequestScope)).method(EHttpMethod.POST).data(new JSAssocArray().add(CLogin.REQUEST_ATTR_USERID, JQuery.idRef(sIDUserName).val()).add(CLogin.REQUEST_ATTR_PASSWORD, JQuery.idRef(sIDPassword).val())).success(aJSSuccess).build());
    }
    aOnClick._return(false);
    aToolbar.addSubmitButton(EPhotonCoreText.LOGIN_BUTTON_SUBMIT.getDisplayText(aDisplayLocale), aOnClick);
    return aForm;
}
Also used : Locale(java.util.Locale) HCDiv(com.helger.html.hc.html.grouping.HCDiv) JSAnonymousFunction(com.helger.html.jscode.JSAnonymousFunction) JSVar(com.helger.html.jscode.JSVar) HCEdit(com.helger.html.hc.html.forms.HCEdit) HCEditPassword(com.helger.html.hc.html.forms.HCEditPassword) BootstrapForm(com.helger.photon.bootstrap4.form.BootstrapForm) IRequestWebScopeWithoutResponse(com.helger.web.scope.IRequestWebScopeWithoutResponse) JQueryAjaxBuilder(com.helger.html.jquery.JQueryAjaxBuilder) JSPackage(com.helger.html.jscode.JSPackage) JSAssocArray(com.helger.html.jscode.JSAssocArray) BootstrapButtonToolbar(com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) RequestField(com.helger.photon.core.form.RequestField) Nonnull(javax.annotation.Nonnull)

Example 23 with BootstrapButtonToolbar

use of com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar in project phoss-smp by phax.

the class PageSecureBusinessCard method showListOfExistingObjects.

@Override
protected void showListOfExistingObjects(@Nonnull final WebPageExecutionContext aWPEC) {
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final ISMPBusinessCardManager aBusinessCardMgr = SMPMetaManager.getBusinessCardMgr();
    final ICommonsList<ISMPBusinessCard> aAllBusinessCards = aBusinessCardMgr.getAllSMPBusinessCards();
    final BootstrapButtonToolbar aToolbar = new BootstrapButtonToolbar(aWPEC);
    aToolbar.addButton("Create new Business Card", createCreateURL(aWPEC), EDefaultIcon.NEW);
    aToolbar.addChild(new BootstrapButton().setOnClick(aWPEC.getSelfHref().add(CPageParam.PARAM_ACTION, ACTION_PUBLISH_ALL_TO_INDEXER)).setIcon(EFamFamIcon.ARROW_REDO).addChild("Update all Business Cards in " + SMPWebAppConfiguration.getDirectoryName()).setDisabled(aAllBusinessCards.isEmpty()));
    aNodeList.addChild(aToolbar);
    final HCTable aTable = new HCTable(new DTCol("Service Group").setDataSort(0, 1).setInitialSorting(ESortOrder.ASCENDING), new DTCol("Name"), new DTCol("Country"), new DTCol("GeoInfo"), new DTCol("Identifiers"), new BootstrapDTColAction(aDisplayLocale)).setID(getID());
    for (final ISMPBusinessCard aCurObject : aAllBusinessCards) {
        final ISimpleURL aViewLink = createViewURL(aWPEC, aCurObject);
        final String sDisplayName = aCurObject.getID();
        if (aCurObject.getEntityCount() == 0) {
            final HCRow aRow = aTable.addBodyRow();
            aRow.addCell(new HCA(aViewLink).addChild(sDisplayName));
            for (int i = 1; i < aTable.getColumnCount() - 1; ++i) aRow.addCell();
            aRow.addCell(_createActionCell(aWPEC, aCurObject));
        } else {
            for (final SMPBusinessCardEntity aEntity : aCurObject.getAllEntities()) {
                final HCRow aRow = aTable.addBodyRow();
                aRow.addCell(new HCA(aViewLink).addChild(sDisplayName));
                aRow.addCell(aEntity.names().getFirst().getName());
                final Locale aCountry = CountryCache.getInstance().getCountry(aEntity.getCountryCode());
                final IHCCell<?> aCountryCell = aRow.addCell();
                final EFamFamFlagIcon eIcon = EFamFamFlagIcon.getFromIDOrNull(aCountry.getCountry());
                if (eIcon != null)
                    aCountryCell.addChild(eIcon.getAsNode()).addChild(" ");
                aCountryCell.addChild(aCountry.getDisplayCountry(aDisplayLocale));
                aRow.addCell(HCExtHelper.nl2divList(aEntity.getGeographicalInformation()));
                {
                    final HCNodeList aIdentifiers = new HCNodeList();
                    for (final SMPBusinessCardIdentifier aIdentifier : aEntity.identifiers()) aIdentifiers.addChild(div(aIdentifier.getScheme()).addChild(" - ").addChild(aIdentifier.getValue()));
                    aRow.addCell(aIdentifiers);
                }
                aRow.addCell(_createActionCell(aWPEC, aCurObject));
            }
        }
    }
    final DataTables aDataTables = BootstrapDataTables.createDefaultDataTables(aWPEC, aTable);
    aNodeList.addChild(aTable).addChild(aDataTables);
}
Also used : Locale(java.util.Locale) HCNodeList(com.helger.html.hc.impl.HCNodeList) HCA(com.helger.html.hc.html.textlevel.HCA) SMPBusinessCardEntity(com.helger.phoss.smp.domain.businesscard.SMPBusinessCardEntity) HCRow(com.helger.html.hc.html.tabular.HCRow) PDTToString(com.helger.commons.datetime.PDTToString) PDTFromString(com.helger.commons.datetime.PDTFromString) SMPBusinessCardIdentifier(com.helger.phoss.smp.domain.businesscard.SMPBusinessCardIdentifier) ISMPBusinessCard(com.helger.phoss.smp.domain.businesscard.ISMPBusinessCard) ISMPBusinessCardManager(com.helger.phoss.smp.domain.businesscard.ISMPBusinessCardManager) HCTable(com.helger.html.hc.html.tabular.HCTable) EFamFamFlagIcon(com.helger.photon.uictrls.famfam.EFamFamFlagIcon) DTCol(com.helger.photon.uictrls.datatables.column.DTCol) ISimpleURL(com.helger.commons.url.ISimpleURL) BootstrapDTColAction(com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDTColAction) BootstrapButton(com.helger.photon.bootstrap4.button.BootstrapButton) BootstrapButtonToolbar(com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar) DataTables(com.helger.photon.uictrls.datatables.DataTables) BootstrapDataTables(com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDataTables)

Example 24 with BootstrapButtonToolbar

use of com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar in project phoss-smp by phax.

the class PageSecureRedirect method showListOfExistingObjects.

@Override
protected void showListOfExistingObjects(@Nonnull final WebPageExecutionContext aWPEC) {
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final ISMPRedirectManager aRedirectMgr = SMPMetaManager.getRedirectMgr();
    final BootstrapButtonToolbar aToolbar = new BootstrapButtonToolbar(aWPEC);
    aToolbar.addButton("Create new Redirect", createCreateURL(aWPEC), EDefaultIcon.NEW);
    aNodeList.addChild(aToolbar);
    final HCTable aTable = new HCTable(new DTCol("Service Group").setDataSort(0, 1).setInitialSorting(ESortOrder.ASCENDING), new DTCol("Document type ID").setDataSort(1, 0), new DTCol("Target URL"), new BootstrapDTColAction(aDisplayLocale)).setID(getID());
    for (final ISMPRedirect aCurObject : aRedirectMgr.getAllSMPRedirects()) {
        final StringMap aParams = new StringMap();
        aParams.putIn(FIELD_SERVICE_GROUP_ID, aCurObject.getServiceGroupID());
        aParams.putIn(FIELD_DOCTYPE_ID, aCurObject.getDocumentTypeIdentifier().getURIEncoded());
        final ISimpleURL aViewLink = createViewURL(aWPEC, aCurObject, aParams);
        final String sDisplayName = aCurObject.getServiceGroupID();
        final HCRow aRow = aTable.addBodyRow();
        aRow.addCell(new HCA(aViewLink).addChild(sDisplayName));
        aRow.addCell(NiceNameUI.getDocumentTypeID(aCurObject.getDocumentTypeIdentifier(), false));
        aRow.addCell(aCurObject.getTargetHref());
        final ISimpleURL aEditURL = createEditURL(aWPEC, aCurObject).addAll(aParams);
        final ISimpleURL aCopyURL = createCopyURL(aWPEC, aCurObject).addAll(aParams);
        final ISimpleURL aDeleteURL = createDeleteURL(aWPEC, aCurObject).addAll(aParams);
        final ISimpleURL aPreviewURL = LinkHelper.getURLWithServerAndContext(aCurObject.getServiceGroup().getParticipantIdentifier().getURIPercentEncoded() + SMPRestFilter.PATH_SERVICES + aCurObject.getDocumentTypeIdentifier().getURIPercentEncoded());
        aRow.addCell(new HCA(aEditURL).setTitle("Edit " + sDisplayName).addChild(EDefaultIcon.EDIT.getAsNode()), new HCTextNode(" "), new HCA(aCopyURL).setTitle("Create a copy of " + sDisplayName).addChild(EDefaultIcon.COPY.getAsNode()), new HCTextNode(" "), new HCA(aDeleteURL).setTitle("Delete " + sDisplayName).addChild(EDefaultIcon.DELETE.getAsNode()), new HCTextNode(" "), new HCA(aPreviewURL).setTitle("Perform SMP query on " + sDisplayName).setTargetBlank().addChild(EFamFamIcon.SCRIPT_GO.getAsNode()));
    }
    final DataTables aDataTables = BootstrapDataTables.createDefaultDataTables(aWPEC, aTable);
    aNodeList.addChild(aTable).addChild(aDataTables);
}
Also used : Locale(java.util.Locale) StringMap(com.helger.commons.collection.attr.StringMap) HCNodeList(com.helger.html.hc.impl.HCNodeList) HCA(com.helger.html.hc.html.textlevel.HCA) HCRow(com.helger.html.hc.html.tabular.HCRow) ISMPRedirectManager(com.helger.phoss.smp.domain.redirect.ISMPRedirectManager) HCTable(com.helger.html.hc.html.tabular.HCTable) DTCol(com.helger.photon.uictrls.datatables.column.DTCol) ISMPRedirect(com.helger.phoss.smp.domain.redirect.ISMPRedirect) ISimpleURL(com.helger.commons.url.ISimpleURL) BootstrapDTColAction(com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDTColAction) BootstrapButtonToolbar(com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar) HCTextNode(com.helger.html.hc.impl.HCTextNode) BootstrapDataTables(com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDataTables) DataTables(com.helger.photon.uictrls.datatables.DataTables)

Example 25 with BootstrapButtonToolbar

use of com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar in project phoss-smp by phax.

the class PageSecureSMLRegistration method fillContent.

@Override
protected void fillContent(@Nonnull final WebPageExecutionContext aWPEC) {
    if (!_canShowPage(aWPEC))
        return;
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final FormErrorList aFormErrors = new FormErrorList();
    final boolean bShowInput = true;
    final ISMLInfo aDefaultSML = SMPMetaManager.getSettings().getSMLInfo();
    final String sSMPID = SMPServerConfiguration.getSMLSMPID();
    if (aDefaultSML != null) {
        // Check if this SMP is already registered
        final String sPublisherDNSName = sSMPID + "." + aDefaultSML.getPublisherDNSZone();
        try {
            final InetAddress aIA = InetAddress.getByName(sPublisherDNSName);
            aNodeList.addChild(success(div("An SMP is already registered at the configured SML using the DNS name '" + sPublisherDNSName + "'. The determined IP address is " + aIA.getHostAddress())).addChild(div("Note: this can be a different machine than this one, if another SMP uses the same ID as this one (" + sSMPID + ")")));
        } catch (final UnknownHostException ex) {
        // continue
        }
    }
    if (aWPEC.hasAction(CPageParam.ACTION_PERFORM)) {
        if (aWPEC.hasSubAction(SUBACTION_SMP_REGISTER))
            _registerSMPtoSML(aWPEC, aFormErrors);
        else if (aWPEC.hasSubAction(SUBACTION_SMP_UPDATE))
            _updateSMPatSML(aWPEC, aFormErrors);
        else if (aWPEC.hasSubAction(SUBACTION_SMP_DELETE))
            _deleteSMPfromSML(aWPEC, aFormErrors);
    }
    if (bShowInput) {
        // Get default from configuration
        final String sPhysicalAddress = SMPServerConfiguration.getSMLSMPIP();
        final String sLogicalAddress = SMPServerConfiguration.getSMLSMPHostname();
        String sDefaultPhysicalAddress = "";
        String sDefaultLogicalAddress = "";
        try {
            final InetAddress aLocalHost = InetAddress.getLocalHost();
            sDefaultPhysicalAddress = aLocalHost.getHostAddress();
            sDefaultLogicalAddress = "http://" + aLocalHost.getCanonicalHostName();
        } catch (final UnknownHostException ex) {
            LOGGER.error("Error determining localhost address", ex);
        }
        final BootstrapTabBox aTabBox = new BootstrapTabBox();
        final Predicate<ISMLInfo> aSMLFilter = ISMLInfo::isClientCertificateRequired;
        // Register SMP at SML
        {
            final BootstrapForm aForm = getUIHandler().createFormSelf(aWPEC).setLeft(3);
            aForm.addChild(info("Register this SMP to the SML. This must only be done once per SMP!"));
            aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("SML").setCtrl(new HCSMLSelect(new RequestField(FIELD_SML_ID, aDefaultSML != null ? aDefaultSML.getID() : null), aDisplayLocale, aSMLFilter)).setErrorList(aFormErrors.getListOfField(FIELD_SML_ID)));
            aForm.addFormGroup(new BootstrapFormGroup().setLabel("SMP ID").setCtrl(em(sSMPID)).setHelpText(HELPTEXT_SMP_ID));
            aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Physical address").setCtrl(new HCEdit(new RequestField(FIELD_PHYSICAL_ADDRESS, sPhysicalAddress)).setPlaceholder("The IPv4 address of your SMP. E.g. 1.2.3.4")).setHelpText(TextHelper.getFormattedText(HELPTEXT_PHYSICAL_ADDRESS, sDefaultPhysicalAddress)).setErrorList(aFormErrors.getListOfField(FIELD_PHYSICAL_ADDRESS)));
            aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Logical address").setCtrl(new HCEdit(new RequestField(FIELD_LOGICAL_ADDRESS, sLogicalAddress)).setPlaceholder("The domain name of your SMP server. E.g. http://smp.example.org")).setHelpText(TextHelper.getFormattedText(HELPTEXT_LOGICAL_ADDRESS, sDefaultLogicalAddress)).setErrorList(aFormErrors.getListOfField(FIELD_LOGICAL_ADDRESS)));
            final BootstrapButtonToolbar aToolbar = aForm.addAndReturnChild(new BootstrapButtonToolbar(aWPEC));
            aToolbar.addHiddenField(CPageParam.PARAM_ACTION, CPageParam.ACTION_PERFORM);
            aToolbar.addHiddenField(CPageParam.PARAM_SUBACTION, SUBACTION_SMP_REGISTER);
            aToolbar.addSubmitButton("Register SMP at SML");
            aTabBox.addTab("register", "Register SMP to SML", aForm, aWPEC.hasSubAction(SUBACTION_SMP_REGISTER));
        }
        // Update SMP at SML
        {
            final BootstrapForm aForm = getUIHandler().createFormSelf(aWPEC).setLeft(3);
            aForm.addChild(info("Update this SMP at the SML. This must only be done when either the IP address or the host name of the SMP changed!"));
            aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("SML").setCtrl(new HCSMLSelect(new RequestField(FIELD_SML_ID, aDefaultSML == null ? null : aDefaultSML.getID()), aDisplayLocale, aSMLFilter)).setErrorList(aFormErrors.getListOfField(FIELD_SML_ID)));
            aForm.addFormGroup(new BootstrapFormGroup().setLabel("SMP ID").setCtrl(em(sSMPID)).setHelpText(HELPTEXT_SMP_ID));
            aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Physical address").setCtrl(new HCEdit(new RequestField(FIELD_PHYSICAL_ADDRESS, sPhysicalAddress)).setPlaceholder("The IPv4 address of your SMP. E.g. 1.2.3.4")).setHelpText(TextHelper.getFormattedText(HELPTEXT_PHYSICAL_ADDRESS, sDefaultPhysicalAddress)).setErrorList(aFormErrors.getListOfField(FIELD_PHYSICAL_ADDRESS)));
            aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("Logical address").setCtrl(new HCEdit(new RequestField(FIELD_LOGICAL_ADDRESS, sLogicalAddress)).setPlaceholder("The domain name of your SMP server. E.g. http://smp.example.org")).setHelpText(TextHelper.getFormattedText(HELPTEXT_LOGICAL_ADDRESS, sDefaultLogicalAddress)).setErrorList(aFormErrors.getListOfField(FIELD_LOGICAL_ADDRESS)));
            final BootstrapButtonToolbar aToolbar = aForm.addAndReturnChild(new BootstrapButtonToolbar(aWPEC));
            aToolbar.addHiddenField(CPageParam.PARAM_ACTION, CPageParam.ACTION_PERFORM);
            aToolbar.addHiddenField(CPageParam.PARAM_SUBACTION, SUBACTION_SMP_UPDATE);
            aToolbar.addSubmitButton("Update SMP at SML");
            aTabBox.addTab("update", "Update SMP at SML", aForm, aWPEC.hasSubAction(SUBACTION_SMP_UPDATE));
        }
        // Delete SMP from SML
        {
            final BootstrapForm aForm = getUIHandler().createFormSelf(aWPEC).setLeft(3);
            aForm.addChild(info("Delete this SMP from the SML."));
            aForm.addFormGroup(new BootstrapFormGroup().setLabelMandatory("SML").setCtrl(new HCSMLSelect(new RequestField(FIELD_SML_ID, aDefaultSML == null ? null : aDefaultSML.getID()), aDisplayLocale, aSMLFilter)).setErrorList(aFormErrors.getListOfField(FIELD_SML_ID)));
            aForm.addFormGroup(new BootstrapFormGroup().setLabel("SMP ID").setCtrl(em(sSMPID)).setHelpText(HELPTEXT_SMP_ID));
            final BootstrapButtonToolbar aToolbar = aForm.addAndReturnChild(new BootstrapButtonToolbar(aWPEC));
            aToolbar.addHiddenField(CPageParam.PARAM_ACTION, CPageParam.ACTION_PERFORM);
            aToolbar.addHiddenField(CPageParam.PARAM_SUBACTION, SUBACTION_SMP_DELETE);
            aToolbar.addSubmitButton("Delete SMP from SML");
            aTabBox.addTab("delete", "Delete SMP from SML", aForm, aWPEC.hasSubAction(SUBACTION_SMP_DELETE));
        }
        aNodeList.addChild(aTabBox);
    }
}
Also used : Locale(java.util.Locale) HCSMLSelect(com.helger.phoss.smp.ui.secure.hc.HCSMLSelect) HCNodeList(com.helger.html.hc.impl.HCNodeList) UnknownHostException(java.net.UnknownHostException) ISMLInfo(com.helger.peppol.sml.ISMLInfo) FormErrorList(com.helger.photon.core.form.FormErrorList) HCEdit(com.helger.html.hc.html.forms.HCEdit) BootstrapTabBox(com.helger.photon.bootstrap4.nav.BootstrapTabBox) BootstrapForm(com.helger.photon.bootstrap4.form.BootstrapForm) BootstrapButtonToolbar(com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup) InetAddress(java.net.InetAddress) RequestField(com.helger.photon.core.form.RequestField)

Aggregations

BootstrapButtonToolbar (com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar)30 HCNodeList (com.helger.html.hc.impl.HCNodeList)26 Locale (java.util.Locale)24 HCRow (com.helger.html.hc.html.tabular.HCRow)15 ISimpleURL (com.helger.commons.url.ISimpleURL)14 HCA (com.helger.html.hc.html.textlevel.HCA)14 DTCol (com.helger.photon.uictrls.datatables.column.DTCol)14 HCTable (com.helger.html.hc.html.tabular.HCTable)13 BootstrapForm (com.helger.photon.bootstrap4.form.BootstrapForm)13 BootstrapFormGroup (com.helger.photon.bootstrap4.form.BootstrapFormGroup)13 BootstrapDTColAction (com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDTColAction)13 BootstrapDataTables (com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDataTables)12 RequestField (com.helger.photon.core.form.RequestField)12 DataTables (com.helger.photon.uictrls.datatables.DataTables)12 BootstrapButton (com.helger.photon.bootstrap4.button.BootstrapButton)11 FormErrorList (com.helger.photon.core.form.FormErrorList)11 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)9 HCEdit (com.helger.html.hc.html.forms.HCEdit)8 HCTextNode (com.helger.html.hc.impl.HCTextNode)8 ISMPServiceGroupManager (com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroupManager)8