use of org.olat.core.gui.components.table.TableController in project openolat by klemens.
the class DENManager method createParticipantsTable.
/**
* Create the table for the participants management view
* @param ureq
* @param wControl
* @param trans
* @param listener
* @param tableData DENParticipantsTableDataModel
* @return TableController
*/
protected TableController createParticipantsTable(UserRequest ureq, WindowControl wControl, Translator trans, DENParticipantsTableDataModel tableData) {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setTableEmptyMessage(trans.translate("dates.table.empty"));
TableController tableCntrl = new TableController(tableConfig, ureq, wControl, trans);
tableCntrl.addColumnDescriptor(new DefaultColumnDescriptor("dates.table.participant.firstname", 0, null, ureq.getLocale()));
tableCntrl.addColumnDescriptor(new DefaultColumnDescriptor("dates.table.participant.lastname", 1, null, ureq.getLocale()));
tableCntrl.addColumnDescriptor(new DefaultColumnDescriptor("dates.table.participant.email", 2, null, ureq.getLocale()));
tableCntrl.addColumnDescriptor(new BooleanColumnDescriptor("dates.table.participant.email.send", 3, DENParticipantsTableDataModel.MAIL_ACTION, trans.translate("dates.table.participant.email.send"), ""));
tableCntrl.addColumnDescriptor(new BooleanColumnDescriptor("dates.table.list.delete", 3, DENParticipantsTableDataModel.REMOVE_ACTION, trans.translate("dates.table.list.delete"), ""));
tableCntrl.setTableDataModel(tableData);
return tableCntrl;
}
use of org.olat.core.gui.components.table.TableController in project openolat by klemens.
the class UsermanagerUserSearchForm method initUserListCtr.
/**
* Initialize the table controller using the list of identities
*
* @param ureq
* @param identitiesList
*/
private void initUserListCtr(UserRequest ureq, List<Identity> myIdentities, Integer searchStatusField) {
removeAsListenerAndDispose(tableCtr);
boolean actionEnabled = true;
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setTableEmptyMessage(translate("error.no.user.found"));
if ((searchStatusField != null) && (searchStatusField.equals(Identity.STATUS_DELETED))) {
actionEnabled = false;
}
tableConfig.setDownloadOffered(true);
tableConfig.setPreferencesOffered(true, "ExtendedIdentitiesTable");
tableConfig.setTableEmptyMessage(translate("error.no.user.found"));
tdm = new ExtendedIdentitiesTableDataModel(ureq, myIdentities, actionEnabled);
OLATResourceable ores = OresHelper.createOLATResourceableInstance("table", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = addToHistory(ureq, ores, null);
tableCtr = new TableController(tableConfig, ureq, bwControl, getTranslator());
tdm.addColumnDescriptors(tableCtr, getTranslator());
tableCtr.setTableDataModel(tdm);
listenTo(tableCtr);
if (showEmailButton) {
tableCtr.addMultiSelectAction("command.mail", CMD_MAIL);
}
if (actionEnabled) {
tableCtr.addMultiSelectAction("action.bulkedit", CMD_BULKEDIT);
}
if (showEmailButton || actionEnabled) {
tableCtr.setMultiSelect(true);
}
}
use of org.olat.core.gui.components.table.TableController in project openolat by klemens.
the class SelectionForm method initializeTableController.
private void initializeTableController(UserRequest ureq) {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setTableEmptyMessage(translate("error.no.user.found"));
removeAsListenerAndDispose(tableCtr);
tableCtr = new TableController(tableConfig, ureq, getWindowControl(), propertyHandlerTranslator);
listenTo(tableCtr);
List<Identity> l = UserDeletionManager.getInstance().getDeletableIdentities(UserDeletionManager.getInstance().getLastLoginDuration());
tdm = new UserDeleteTableModel(l, ureq.getLocale(), isAdministrativeUser);
tdm.addColumnDescriptors(tableCtr, null);
tableCtr.addColumnDescriptor(new StaticColumnDescriptor(ACTION_SINGLESELECT_CHOOSE, "table.header.action", translate("action.activate")));
tableCtr.addMultiSelectAction("action.delete.selection", ACTION_MULTISELECT_CHOOSE);
tableCtr.setMultiSelect(true);
tableCtr.setTableDataModel(tdm);
}
use of org.olat.core.gui.components.table.TableController in project openolat by klemens.
the class StatusController method initializeTableController.
private void initializeTableController(UserRequest ureq) {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setTableEmptyMessage(translate("error.no.user.found"));
removeAsListenerAndDispose(tableCtr);
tableCtr = new TableController(tableConfig, ureq, getWindowControl(), this.propertyHandlerTranslator);
listenTo(tableCtr);
List<Identity> l = UserDeletionManager.getInstance().getIdentitiesInDeletionProcess(UserDeletionManager.getInstance().getDeleteEmailDuration());
tdm = new UserDeleteTableModel(l, ureq.getLocale(), isAdministrativeUser);
tdm.addColumnDescriptors(tableCtr, null, "table.identity.deleteEmail");
tableCtr.addColumnDescriptor(new StaticColumnDescriptor(ACTION_SINGLESELECT_CHOOSE, "table.header.action", translate("action.activate")));
tableCtr.setMultiSelect(false);
tableCtr.setTableDataModel(tdm);
userDeleteStatusPanel.setContent(tableCtr.getInitialComponent());
}
use of org.olat.core.gui.components.table.TableController in project openolat by klemens.
the class UserSearchController method doSearch.
private void doSearch(UserRequest ureq) {
String login = searchform.login.getValue();
// build user fields search map
Map<String, String> userPropertiesSearch = new HashMap<>();
for (UserPropertyHandler userPropertyHandler : searchform.userPropertyHandlers) {
if (userPropertyHandler == null)
continue;
FormItem ui = searchform.propFormItems.get(userPropertyHandler.getName());
String uiValue = userPropertyHandler.getStringValue(ui);
if (userPropertyHandler.getName().startsWith("genericCheckboxProperty")) {
if (!"false".equals(uiValue)) {
userPropertiesSearch.put(userPropertyHandler.getName(), uiValue);
}
} else if (StringHelper.containsNonWhitespace(uiValue)) {
userPropertiesSearch.put(userPropertyHandler.getName(), uiValue);
}
}
if (userPropertiesSearch.isEmpty()) {
userPropertiesSearch = null;
}
tableCtr = new TableController(tableConfig, ureq, getWindowControl(), myContent.getTranslator());
listenTo(tableCtr);
List<Identity> users = searchUsers(login, userPropertiesSearch, true);
int maxResults = securityModule.getUserSearchMaxResultsValue();
if (maxResults > 0 && users.size() > maxResults) {
users = users.subList(0, maxResults);
showWarning("error.search.maxResults", Integer.toString(maxResults));
}
if (!users.isEmpty()) {
tdm = new UserTableDataModel(users, getLocale(), isAdministrativeUser);
// add the data column descriptors
tdm.addColumnDescriptors(tableCtr, null);
// add the action columns
if (useMultiSelect) {
// add multiselect action
tableCtr.addMultiSelectAction(this.actionKeyChoose, ACTION_MULTISELECT_CHOOSE);
} else {
// add single column selec action
tableCtr.addColumnDescriptor(new StaticColumnDescriptor(ACTION_SINGLESELECT_CHOOSE, "table.header.action", myContent.getTranslator().translate("action.choose")));
}
tableCtr.setTableDataModel(tdm);
tableCtr.setMultiSelect(useMultiSelect);
searchPanel.pushContent(tableCtr.getInitialComponent());
myContent.contextPut("showButton", "true");
} else {
getWindowControl().setInfo(translate("error.no.user.found"));
}
}
Aggregations