Search in sources :

Example 16 with DataTables

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);
}
Also used : Locale(java.util.Locale) HCNodeList(com.helger.html.hc.impl.HCNodeList) HCA(com.helger.html.hc.html.textlevel.HCA) ISMLConfiguration(com.helger.peppol.domain.ISMLConfiguration) HCRow(com.helger.html.hc.html.tabular.HCRow) HCTable(com.helger.html.hc.html.tabular.HCTable) ISMLConfigurationManager(com.helger.peppol.app.mgr.ISMLConfigurationManager) DTCol(com.helger.photon.uictrls.datatables.column.DTCol) 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) DataTables(com.helger.photon.uictrls.datatables.DataTables) BootstrapDataTables(com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDataTables)

Aggregations

ISimpleURL (com.helger.commons.url.ISimpleURL)16 HCRow (com.helger.html.hc.html.tabular.HCRow)16 HCTable (com.helger.html.hc.html.tabular.HCTable)16 HCNodeList (com.helger.html.hc.impl.HCNodeList)16 BootstrapDataTables (com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDataTables)16 DataTables (com.helger.photon.uictrls.datatables.DataTables)16 DTCol (com.helger.photon.uictrls.datatables.column.DTCol)16 Locale (java.util.Locale)16 HCA (com.helger.html.hc.html.textlevel.HCA)15 BootstrapDTColAction (com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDTColAction)15 BootstrapButtonToolbar (com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar)13 HCTextNode (com.helger.html.hc.impl.HCTextNode)10 PDTToString (com.helger.commons.datetime.PDTToString)5 ISMPServiceGroup (com.helger.phoss.smp.domain.servicegroup.ISMPServiceGroup)4 ISMPServiceInformation (com.helger.phoss.smp.domain.serviceinfo.ISMPServiceInformation)4 ISMPServiceInformationManager (com.helger.phoss.smp.domain.serviceinfo.ISMPServiceInformationManager)4 ICommonsList (com.helger.commons.collection.impl.ICommonsList)3 ISMPEndpoint (com.helger.phoss.smp.domain.serviceinfo.ISMPEndpoint)3 ISMPProcess (com.helger.phoss.smp.domain.serviceinfo.ISMPProcess)3 Nonnull (javax.annotation.Nonnull)3