Search in sources :

Example 36 with HCNodeList

use of com.helger.html.hc.impl.HCNodeList in project peppol-practical by phax.

the class PageSecureAdminAddons method fillContent.

@Override
public void fillContent(@Nonnull final WebPageExecutionContext aWPEC) {
    final HCNodeList aNodeList = aWPEC.getNodeList();
    // Perform
    aNodeList.addChild(_handleAction(aWPEC.getAction()));
    aNodeList.addChild(h2("Cache handling"));
    aNodeList.addChild(div(new BootstrapButton().setOnClick(aWPEC.getSelfHref().add(CPageParam.PARAM_ACTION, ACTION_EXPIRE_PAGE_CACHE)).addChild("Expire static page cache")));
}
Also used : HCNodeList(com.helger.html.hc.impl.HCNodeList) BootstrapButton(com.helger.photon.bootstrap4.button.BootstrapButton)

Example 37 with HCNodeList

use of com.helger.html.hc.impl.HCNodeList in project peppol-practical by phax.

the class PageSecureCRMGroup method showSelectedObject.

@Override
protected void showSelectedObject(@Nonnull final WebPageExecutionContext aWPEC, final ICRMGroup aSelectedObject) {
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final CRMSubscriberManager aCRMSubscriberMgr = PPMetaManager.getCRMSubscriberMgr();
    final BootstrapViewForm aForm = aNodeList.addAndReturnChild(new BootstrapViewForm());
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Name").setCtrl(aSelectedObject.getDisplayName()));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Sender email address").setCtrl(aSelectedObject.getSenderEmailAddress()));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Assigned participants").setCtrl(Long.toString(aCRMSubscriberMgr.getCRMSubscriberCountOfGroup(aSelectedObject))));
}
Also used : CRMSubscriberManager(com.helger.peppol.crm.CRMSubscriberManager) HCNodeList(com.helger.html.hc.impl.HCNodeList) BootstrapViewForm(com.helger.photon.bootstrap4.form.BootstrapViewForm) BootstrapFormGroup(com.helger.photon.bootstrap4.form.BootstrapFormGroup)

Example 38 with HCNodeList

use of com.helger.html.hc.impl.HCNodeList in project peppol-practical by phax.

the class PageSecureCRMGroup method showListOfExistingObjects.

@Override
protected void showListOfExistingObjects(@Nonnull final WebPageExecutionContext aWPEC) {
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final CRMGroupManager aCRMGroupMgr = PPMetaManager.getCRMGroupMgr();
    // Toolbar on top
    final BootstrapButtonToolbar aToolbar = aNodeList.addAndReturnChild(new BootstrapButtonToolbar(aWPEC));
    aToolbar.addButtonNew("Create new CRM group", createCreateURL(aWPEC));
    // List existing
    final HCTable aTable = new HCTable(new DTCol("Name").setInitialSorting(ESortOrder.ASCENDING), new DTCol("Sender email address"), new BootstrapDTColAction(aDisplayLocale)).setID(getID());
    for (final ICRMGroup aCurObject : aCRMGroupMgr.getAll()) {
        final ISimpleURL aViewLink = createViewURL(aWPEC, aCurObject);
        final HCRow aRow = aTable.addBodyRow();
        aRow.addCell(new HCA(aViewLink).addChild(aCurObject.getDisplayName()));
        aRow.addCell(aCurObject.getSenderEmailAddress());
        aRow.addCell(createEditLink(aWPEC, aCurObject), new HCTextNode(" "), createCopyLink(aWPEC, aCurObject));
    }
    aNodeList.addChild(aTable);
    final DataTables aDataTables = BootstrapDataTables.createDefaultDataTables(aWPEC, aTable);
    aNodeList.addChild(aDataTables);
}
Also used : Locale(java.util.Locale) HCNodeList(com.helger.html.hc.impl.HCNodeList) HCA(com.helger.html.hc.html.textlevel.HCA) HCRow(com.helger.html.hc.html.tabular.HCRow) CRMGroupManager(com.helger.peppol.crm.CRMGroupManager) HCTable(com.helger.html.hc.html.tabular.HCTable) 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) ICRMGroup(com.helger.peppol.crm.ICRMGroup) DataTables(com.helger.photon.uictrls.datatables.DataTables) BootstrapDataTables(com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDataTables)

Example 39 with HCNodeList

use of com.helger.html.hc.impl.HCNodeList in project peppol-practical by phax.

the class PageSecureCRMSubscriber method showSelectedObject.

@Override
protected void showSelectedObject(@Nonnull final WebPageExecutionContext aWPEC, final ICRMSubscriber aSelectedObject) {
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    final HCNodeList aNodeList = aWPEC.getNodeList();
    final BootstrapViewForm aForm = aNodeList.addAndReturnChild(new BootstrapViewForm());
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Status").setCtrl(aSelectedObject.isDeleted() ? "Deleted" : "Active"));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Salutation").setCtrl(aSelectedObject.getSalutationDisplayName(aDisplayLocale)));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Name").setCtrl(aSelectedObject.getName()));
    aForm.addFormGroup(new BootstrapFormGroup().setLabel("Email address").setCtrl(aSelectedObject.getEmailAddress()));
    {
        final HCNodeList aGroups = new HCNodeList();
        for (final ICRMGroup aCRMGroup : CollectionHelper.getSorted(aSelectedObject.getAllAssignedGroups(), IHasDisplayName.getComparatorCollating(aDisplayLocale))) aGroups.addChild(div(new HCA(createViewURL(aWPEC, CMenuSecure.MENU_CRM_GROUPS, aCRMGroup)).addChild(aCRMGroup.getDisplayName())));
        aForm.addFormGroup(new BootstrapFormGroup().setLabel("Assigned groups").setCtrl(aGroups));
    }
}
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) ICRMGroup(com.helger.peppol.crm.ICRMGroup)

Example 40 with HCNodeList

use of com.helger.html.hc.impl.HCNodeList in project peppol-practical by phax.

the class PageSecureCRMSubscriber method _getList.

@Nonnull
private IHCNode _getList(@Nonnull final WebPageExecutionContext aWPEC, @Nonnull final Collection<? extends ICRMSubscriber> aCRMSubscribers, @Nonnull final String sIDSuffix) {
    final Locale aDisplayLocale = aWPEC.getDisplayLocale();
    // List existing
    final HCTable aTable = new HCTable(new DTCol("Name").setInitialSorting(ESortOrder.ASCENDING), new DTCol("Email address"), new DTCol("Last Mod").setDisplayType(EDTColType.DATETIME, aDisplayLocale), new DTCol("Groups"), new BootstrapDTColAction(aDisplayLocale)).setID(getID() + sIDSuffix);
    for (final ICRMSubscriber aCurObject : aCRMSubscribers) {
        final ISimpleURL aViewLink = createViewURL(aWPEC, aCurObject);
        final HCRow aRow = aTable.addBodyRow();
        aRow.addCell(new HCA(aViewLink).addChild(StringHelper.getConcatenatedOnDemand(aCurObject.getSalutationDisplayName(aDisplayLocale), " ", aCurObject.getName())));
        aRow.addCell(aCurObject.getEmailAddress());
        aRow.addCell(PDTToString.getAsString(aCurObject.hasLastModificationDateTime() ? aCurObject.getLastModificationDateTime() : aCurObject.getCreationDateTime(), aDisplayLocale));
        aRow.addCell(HCExtHelper.nl2divList(aCurObject.getAllAssignedGroups().stream().map(ICRMGroup::getDisplayName).collect(Collectors.joining("\n"))));
        final IHCCell<?> aActionCell = aRow.addCell();
        aActionCell.addChildren(createEditLink(aWPEC, aCurObject), new HCTextNode(" "), createCopyLink(aWPEC, aCurObject), new HCTextNode(" "));
        aActionCell.addChild(isActionAllowed(aWPEC, EWebPageFormAction.DELETE, aCurObject) ? createDeleteLink(aWPEC, aCurObject) : createEmptyAction());
    }
    final DataTables aDataTables = BootstrapDataTables.createDefaultDataTables(aWPEC, aTable);
    return new HCNodeList().addChild(aTable).addChild(aDataTables);
}
Also used : Locale(java.util.Locale) HCTable(com.helger.html.hc.html.tabular.HCTable) HCNodeList(com.helger.html.hc.impl.HCNodeList) DTCol(com.helger.photon.uictrls.datatables.column.DTCol) ISimpleURL(com.helger.commons.url.ISimpleURL) HCA(com.helger.html.hc.html.textlevel.HCA) BootstrapDTColAction(com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDTColAction) HCRow(com.helger.html.hc.html.tabular.HCRow) ICRMSubscriber(com.helger.peppol.crm.ICRMSubscriber) HCTextNode(com.helger.html.hc.impl.HCTextNode) BootstrapDataTables(com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDataTables) DataTables(com.helger.photon.uictrls.datatables.DataTables) Nonnull(javax.annotation.Nonnull)

Aggregations

HCNodeList (com.helger.html.hc.impl.HCNodeList)123 Locale (java.util.Locale)74 BootstrapFormGroup (com.helger.photon.bootstrap4.form.BootstrapFormGroup)42 Nonnull (javax.annotation.Nonnull)41 BootstrapButtonToolbar (com.helger.photon.bootstrap4.buttongroup.BootstrapButtonToolbar)40 HCA (com.helger.html.hc.html.textlevel.HCA)35 PDTToString (com.helger.commons.datetime.PDTToString)28 ISimpleURL (com.helger.commons.url.ISimpleURL)27 HCRow (com.helger.html.hc.html.tabular.HCRow)26 BootstrapButton (com.helger.photon.bootstrap4.button.BootstrapButton)24 RequestField (com.helger.photon.core.form.RequestField)24 DTCol (com.helger.photon.uictrls.datatables.column.DTCol)24 HCTable (com.helger.html.hc.html.tabular.HCTable)23 BootstrapViewForm (com.helger.photon.bootstrap4.form.BootstrapViewForm)23 BootstrapForm (com.helger.photon.bootstrap4.form.BootstrapForm)21 BootstrapDTColAction (com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDTColAction)21 FormErrorList (com.helger.photon.core.form.FormErrorList)21 BootstrapDataTables (com.helger.photon.bootstrap4.uictrls.datatables.BootstrapDataTables)20 HCTextNode (com.helger.html.hc.impl.HCTextNode)19 IParticipantIdentifier (com.helger.peppolid.IParticipantIdentifier)19