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