use of com.helger.photon.bootstrap4.button.BootstrapButton in project phoss-smp by phax.
the class PageSecureSMPIdentifierMappings method fillContent.
@Override
protected void fillContent(@Nonnull final WebPageExecutionContext aWPEC) {
final HCNodeList aNodeList = aWPEC.getNodeList();
final BootstrapButtonToolbar aToolbar = aNodeList.addAndReturnChild(new BootstrapButtonToolbar(aWPEC));
aToolbar.addChild(new BootstrapButton().addChild("Reload").setIcon(EDefaultIcon.REFRESH).setOnClick(aWPEC.getSelfHref().add(CPageParam.PARAM_ACTION, ACTION_RELOAD)));
if (aWPEC.hasAction(ACTION_RELOAD)) {
NiceNameHandler.reloadNames();
aNodeList.addChild(success("Successfully reloaded name mappings"));
}
final BootstrapTabBox aTabBox = aNodeList.addAndReturnChild(new BootstrapTabBox());
aTabBox.addTab("doctypes", "Document Types", _createList(aWPEC, NiceNameHandler.getAllDocumentTypeMappings(), "doctypes"));
aTabBox.addTab("procs", "Processes", _createList(aWPEC, NiceNameHandler.getAllProcessMappings(), "procs"));
}
use of com.helger.photon.bootstrap4.button.BootstrapButton in project phoss-smp by phax.
the class PageSecureServiceGroupMigrationInbound method showListOfExistingObjects.
@Override
protected void showListOfExistingObjects(@Nonnull final WebPageExecutionContext aWPEC) {
final HCNodeList aNodeList = aWPEC.getNodeList();
final ISMPParticipantMigrationManager aParticipantMigrationMgr = SMPMetaManager.getParticipantMigrationMgr();
final ISMPSettings aSettings = SMPMetaManager.getSettings();
{
final HCOL aOL = new HCOL();
aOL.addItem("The migration was initiated by another SMP, and the SML must have been informed about the upcoming migration");
aOL.addItem("This SMP, that is taking over the Service Group, must acknowledge the migration by providing the same migration code (created by the other SMP) to the SML");
aOL.addItem("If the migration was successful, the Service Group must be deleted from the other SMP, ideally a temporary redirect to the new SMP is created");
aNodeList.addChild(info().addChild(div("The process of migrating a Service Group to another SMP consists of multiple steps:")).addChild(aOL).addChild(div("If a Migration is unsuccessful, it can be retried later.")));
}
EValidity eCanMigrate = EValidity.VALID;
if (aSettings.getSMLInfo() == null) {
final BootstrapWarnBox aWarnBox = aNodeList.addAndReturnChild(warn().addChild(div("No valid SML Configuration is selected hence no participant can be migrated.")).addChild(new BootstrapButton().addChild("Select SML Configuration in the Settings").setOnClick(aWPEC.getLinkToMenuItem(CMenuSecure.MENU_SMP_SETTINGS)).setIcon(EDefaultIcon.EDIT)));
if (aSettings.isSMLEnabled() || aSettings.isSMLRequired()) {
aWarnBox.addChild(div(new BootstrapButton().addChild("Create a new SML Configuration").setOnClick(createCreateURL(aWPEC, CMenuSecure.MENU_SML_CONFIGURATION)).setIcon(EDefaultIcon.YES)));
}
eCanMigrate = EValidity.INVALID;
} else if (!aSettings.isSMLEnabled()) {
aNodeList.addChild(warn().addChild(div("SML Connection is not enabled hence no participant can be migrated.")).addChild(div(new BootstrapButton().addChild("Enable SML in the Settings").setOnClick(aWPEC.getLinkToMenuItem(CMenuSecure.MENU_SMP_SETTINGS)).setIcon(EDefaultIcon.EDIT))));
eCanMigrate = EValidity.INVALID;
}
{
final BootstrapButtonToolbar aToolbar = new BootstrapButtonToolbar(aWPEC);
aToolbar.addButton("Refresh", aWPEC.getSelfHref(), EDefaultIcon.REFRESH);
aToolbar.addChild(new BootstrapButton().addChild("Start Participant Migration").setOnClick(createCreateURL(aWPEC)).setDisabled(eCanMigrate.isInvalid()).setIcon(EDefaultIcon.NEW));
aNodeList.addChild(aToolbar);
}
final BootstrapTabBox aTabBox = aNodeList.addAndReturnChild(new BootstrapTabBox());
final ICommonsList<ISMPParticipantMigration> aAllMigs = aParticipantMigrationMgr.getAllInboundParticipantMigrations(null);
for (final EParticipantMigrationState eState : EParticipantMigrationState.values()) if (eState.isInboundState()) {
final ICommonsList<ISMPParticipantMigration> aMatchingMigs = aAllMigs.getAll(x -> x.getState() == eState);
aTabBox.addTab(eState.getID(), eState.getDisplayName() + " (" + aMatchingMigs.size() + ")", _createTable(aWPEC, aMatchingMigs, eState));
}
}
use of com.helger.photon.bootstrap4.button.BootstrapButton in project phoss-smp by phax.
the class PageSecureRedirect method isValidToDisplayPage.
@Override
@Nonnull
protected IValidityIndicator isValidToDisplayPage(@Nonnull final WebPageExecutionContext aWPEC) {
final HCNodeList aNodeList = aWPEC.getNodeList();
final ISMPServiceGroupManager aServiceGroupManager = SMPMetaManager.getServiceGroupMgr();
if (aServiceGroupManager.getSMPServiceGroupCount() <= 0) {
aNodeList.addChild(warn("No Service Group is present! At least one Service Group must be present to create a Redirect for it."));
aNodeList.addChild(new BootstrapButton().addChild("Create new Service Group").setOnClick(createCreateURL(aWPEC, CMenuSecure.MENU_SERVICE_GROUPS)).setIcon(EDefaultIcon.YES));
return EValidity.INVALID;
}
return super.isValidToDisplayPage(aWPEC);
}
use of com.helger.photon.bootstrap4.button.BootstrapButton in project phoss-smp by phax.
the class SMPRendererSecure method _getNavbar.
@Nonnull
private static IHCNode _getNavbar(@Nonnull final ILayoutExecutionContext aLEC) {
final Locale aDisplayLocale = aLEC.getDisplayLocale();
final IRequestWebScopeWithoutResponse aRequestScope = aLEC.getRequestScope();
final ISimpleURL aLinkToStartPage = aLEC.getLinkToMenuItem(aLEC.getMenuTree().getDefaultMenuItemID());
final BootstrapNavbar aNavbar = new BootstrapNavbar();
aNavbar.addBrand(SMPRendererPublic.createLogo(aLEC), aLinkToStartPage);
aNavbar.addBrand(new HCSpan().addChild(CSMP.getApplicationSuffix() + " Administration"), aLinkToStartPage);
aNavbar.addAndReturnText().addChild(" [" + SMPServerConfiguration.getSMLSMPID() + "]");
final BootstrapNavbarToggleable aToggleable = aNavbar.addAndReturnToggleable();
{
aToggleable.addChild(new BootstrapButton().addClass(CBootstrapCSS.ML_AUTO).addClass(CBootstrapCSS.MR_2).setOnClick(LinkHelper.getURLWithContext(AbstractPublicApplicationServlet.SERVLET_DEFAULT_PATH + "/")).addChild("Goto public view"));
final IUser aUser = aLEC.getLoggedInUser();
aToggleable.addAndReturnText().addClass(CBootstrapCSS.MX_2).addChild("Logged in as ").addChild(new HCStrong().addChild(SecurityHelper.getUserDisplayName(aUser, aDisplayLocale)));
aToggleable.addChild(new BootstrapButton().addClass(CBootstrapCSS.MX_2).setOnClick(LinkHelper.getURLWithContext(aRequestScope, LogoutServlet.SERVLET_DEFAULT_PATH)).addChild(EPhotonCoreText.LOGIN_LOGOUT.getDisplayText(aDisplayLocale)));
}
return aNavbar;
}
use of com.helger.photon.bootstrap4.button.BootstrapButton in project peppol-practical by phax.
the class LayoutAreaContentProviderSecure method _getNavbar.
@Nonnull
private static IHCNode _getNavbar(@Nonnull final LayoutExecutionContext aLEC) {
final Locale aDisplayLocale = aLEC.getDisplayLocale();
final IRequestWebScopeWithoutResponse aRequestScope = aLEC.getRequestScope();
final ISimpleURL aLinkToStartPage = aLEC.getLinkToMenuItem(aLEC.getMenuTree().getDefaultMenuItemID());
final BootstrapNavbar aNavbar = new BootstrapNavbar();
aNavbar.addBrand(new HCNodeList().addChild(new HCSpan().addClass(AppCommonUI.CSS_CLASS_LOGO1).addChild(AppHelper.getApplicationTitle())).addChild(new HCSpan().addClass(AppCommonUI.CSS_CLASS_LOGO2).addChild(" Administration")), aLinkToStartPage);
final BootstrapNavbarToggleable aToggleable = aNavbar.addAndReturnToggleable();
final IUser aUser = LoggedInUserManager.getInstance().getCurrentUser();
aToggleable.addAndReturnText().addClass(CBootstrapCSS.ML_AUTO).addClass(CBootstrapCSS.MX_2).addChild("Welcome ").addChild(new HCStrong().addChild(SecurityHelper.getUserDisplayName(aUser, aDisplayLocale)));
aToggleable.addChild(new BootstrapButton().setOnClick(LinkHelper.getURLWithContext(AbstractPublicApplicationServlet.SERVLET_DEFAULT_PATH)).addChild("Public area").addClass(CBootstrapCSS.MX_2));
aToggleable.addChild(new BootstrapButton().setOnClick(LinkHelper.getURLWithContext(aRequestScope, LogoutServlet.SERVLET_DEFAULT_PATH)).addChild(EPhotonCoreText.LOGIN_LOGOUT.getDisplayText(aDisplayLocale)).addClass(CBootstrapCSS.MX_2));
return aNavbar;
}
Aggregations