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));
}
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);
}
Aggregations