Search in sources :

Example 1 with UserTableDataModel

use of org.olat.admin.user.UserTableDataModel in project OpenOLAT by OpenOLAT.

the class UserControllerFactory method createTableControllerFor.

public static TableController createTableControllerFor(TableGuiConfiguration tableConfig, List<Identity> identities, UserRequest ureq, WindowControl wControl, String actionCommand) {
    Locale loc = ureq.getLocale();
    Translator trans = Util.createPackageTranslator(UserControllerFactory.class, loc);
    trans = UserManager.getInstance().getPropertyHandlerTranslator(trans);
    TableController tableCtr = new TableController(tableConfig, ureq, wControl, trans);
    Roles roles = ureq.getUserSession().getRoles();
    boolean isAdministrativeUser = (roles.isAuthor() || roles.isGroupManager() || roles.isUserManager() || roles.isOLATAdmin());
    UserTableDataModel userDataModel = new UserTableDataModel(identities, loc, isAdministrativeUser);
    userDataModel.addColumnDescriptors(tableCtr, actionCommand);
    tableCtr.setTableDataModel(userDataModel);
    return tableCtr;
}
Also used : Locale(java.util.Locale) UserTableDataModel(org.olat.admin.user.UserTableDataModel) Translator(org.olat.core.gui.translator.Translator) TableController(org.olat.core.gui.components.table.TableController) Roles(org.olat.core.id.Roles)

Example 2 with UserTableDataModel

use of org.olat.admin.user.UserTableDataModel in project openolat by klemens.

the class UserControllerFactory method createTableControllerFor.

public static TableController createTableControllerFor(TableGuiConfiguration tableConfig, List<Identity> identities, UserRequest ureq, WindowControl wControl, String actionCommand) {
    Locale loc = ureq.getLocale();
    Translator trans = Util.createPackageTranslator(UserControllerFactory.class, loc);
    trans = UserManager.getInstance().getPropertyHandlerTranslator(trans);
    TableController tableCtr = new TableController(tableConfig, ureq, wControl, trans);
    Roles roles = ureq.getUserSession().getRoles();
    boolean isAdministrativeUser = (roles.isAuthor() || roles.isGroupManager() || roles.isUserManager() || roles.isOLATAdmin());
    UserTableDataModel userDataModel = new UserTableDataModel(identities, loc, isAdministrativeUser);
    userDataModel.addColumnDescriptors(tableCtr, actionCommand);
    tableCtr.setTableDataModel(userDataModel);
    return tableCtr;
}
Also used : Locale(java.util.Locale) UserTableDataModel(org.olat.admin.user.UserTableDataModel) Translator(org.olat.core.gui.translator.Translator) TableController(org.olat.core.gui.components.table.TableController) Roles(org.olat.core.id.Roles)

Aggregations

Locale (java.util.Locale)2 UserTableDataModel (org.olat.admin.user.UserTableDataModel)2 TableController (org.olat.core.gui.components.table.TableController)2 Translator (org.olat.core.gui.translator.Translator)2 Roles (org.olat.core.id.Roles)2