Search in sources :

Example 81 with HCNodeList

use of com.helger.html.hc.impl.HCNodeList in project phoss-smp by phax.

the class PageSecureServiceGroupExport method fillContent.

@Override
protected void fillContent(@Nonnull final WebPageExecutionContext aWPEC) {
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final IRequestWebScopeWithoutResponse aRequestScope = aWPEC.getRequestScope();
    final ISMPSettings aSettings = SMPMetaManager.getSettings();
    final ISMPServiceGroupManager aServiceGroupMgr = SMPMetaManager.getServiceGroupMgr();
    final long nServiceGroupCount = aServiceGroupMgr.getSMPServiceGroupCount();
    final boolean bHandleBusinessCards = aSettings.isDirectoryIntegrationEnabled();
    if (nServiceGroupCount < 0)
        aNodeList.addChild(error("The number of service groups is unknown, hence nothing can be exported!"));
    else if (nServiceGroupCount == 0)
        aNodeList.addChild(warn("Since no service group is present, nothing can be exported!"));
    else {
        aNodeList.addChild(info("Export " + (nServiceGroupCount == 1 ? "service group" : "all " + nServiceGroupCount + " service groups") + (bHandleBusinessCards ? " and business card" + (nServiceGroupCount == 1 ? "" : "s") : "") + " to an XML file."));
    }
    // The main export logic happens in the AJAX handler
    final BootstrapButtonToolbar aToolbar = aNodeList.addAndReturnChild(getUIHandler().createToolbar(aWPEC));
    aToolbar.addChild(new BootstrapButton().addChild("Export all Service Groups").setIcon(EDefaultIcon.SAVE_ALL).setOnClick(AJAX_EXPORT_SG.getInvocationURL(aRequestScope)).setDisabled(nServiceGroupCount <= 0));
}
Also used : IRequestWebScopeWithoutResponse(com.helger.web.scope.IRequestWebScopeWithoutResponse) ISMPServiceGroupManager(com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroupManager) HCNodeList(com.helger.html.hc.impl.HCNodeList) ISMPSettings(com.helger.phoss.smp.settings.ISMPSettings) BootstrapButton(com.helger.photon.bootstrap4.button.BootstrapButton) BootstrapButtonToolbar(com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar)

Example 82 with HCNodeList

use of com.helger.html.hc.impl.HCNodeList 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

HCNodeList (com.helger.html.hc.impl.HCNodeList)82 Locale (java.util.Locale)50 Nonnull (javax.annotation.Nonnull)31 BootstrapFormGroup (com.helger.photon.bootstrap4.form.BootstrapFormGroup)27 BootstrapButtonToolbar (com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar)26 HCA (com.helger.html.hc.html.textlevel.HCA)25 HCRow (com.helger.html.hc.html.tabular.HCRow)21 BootstrapButton (com.helger.photon.bootstrap4.button.BootstrapButton)20 ISimpleURL (com.helger.commons.url.ISimpleURL)19 DTCol (com.helger.photon.uictrls.datatables.column.DTCol)19 PDTToString (com.helger.commons.datetime.PDTToString)18 HCTable (com.helger.html.hc.html.tabular.HCTable)18 BootstrapViewForm (com.helger.photon.bootstrap4.form.BootstrapViewForm)18 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)17 BootstrapDTColAction (com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDTColAction)17 ISMPServiceGroupManager (com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroupManager)16 BootstrapDataTables (com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDataTables)15 DataTables (com.helger.photon.uictrls.datatables.DataTables)14 RequestField (com.helger.photon.core.form.RequestField)13 BootstrapForm (com.helger.photon.bootstrap4.form.BootstrapForm)12