use of com.helger.photon.uictrls.datatables.DataTables in project peppol-practical by phax.
the class PageSecureSMLConfiguration method showListOfExistingObjects.
@Override
protected void showListOfExistingObjects(@Nonnull final WebPageExecutionContext aWPEC) {
final Locale aDisplayLocale = aWPEC.getDisplayLocale();
final HCNodeList aNodeList = aWPEC.getNodeList();
final ISMLConfigurationManager aSMLConfigurationMgr = PPMetaManager.getSMLConfigurationMgr();
aNodeList.addChild(info("This page lets you create custom SML configurations that can be used for registration."));
final BootstrapButtonToolbar aToolbar = new BootstrapButtonToolbar(aWPEC);
aToolbar.addButton("Create new SML configuration", createCreateURL(aWPEC), EDefaultIcon.NEW);
aNodeList.addChild(aToolbar);
final HCTable aTable = new HCTable(new DTCol("ID"), new DTCol("Name").setInitialSorting(ESortOrder.ASCENDING), new DTCol("DNS Zone"), new DTCol("Management Service URL"), new DTCol("Client Cert?"), new DTCol("SMP API type"), new DTCol("SMP ID type"), new DTCol("Production?"), new BootstrapDTColAction(aDisplayLocale)).setID(getID());
for (final ISMLConfiguration aCurObject : aSMLConfigurationMgr.getAll()) {
final ISimpleURL aViewLink = createViewURL(aWPEC, aCurObject);
final HCRow aRow = aTable.addBodyRow();
aRow.addCell(aCurObject.getID());
aRow.addCell(new HCA(aViewLink).addChild(aCurObject.getDisplayName()));
aRow.addCell(aCurObject.getDNSZone());
aRow.addCell(aCurObject.getManagementServiceURL());
aRow.addCell(EPhotonCoreText.getYesOrNo(aCurObject.isClientCertificateRequired(), aDisplayLocale));
aRow.addCell(aCurObject.getSMPAPIType().getDisplayName());
aRow.addCell(aCurObject.getSMPIdentifierType().getDisplayName());
aRow.addCell(EPhotonCoreText.getYesOrNo(aCurObject.isProduction(), aDisplayLocale));
aRow.addCell(createEditLink(aWPEC, aCurObject, "Edit " + aCurObject.getID()), new HCTextNode(" "), createCopyLink(aWPEC, aCurObject, "Copy " + aCurObject.getID()), new HCTextNode(" "), isActionAllowed(aWPEC, EWebPageFormAction.DELETE, aCurObject) ? createDeleteLink(aWPEC, aCurObject, "Delete " + aCurObject.getDisplayName()) : createEmptyAction());
}
final DataTables aDataTables = BootstrapDataTables.createDefaultDataTables(aWPEC, aTable);
aNodeList.addChild(aTable).addChild(aDataTables);
}
Aggregations