use of org.olat.core.gui.components.table.TableGuiConfiguration in project OpenOLAT by OpenOLAT.
the class GroupController method init.
protected void init(UserRequest ureq, boolean mayModifyMembers, boolean keepAtLeastOne, boolean enableTablePreferences, boolean enableUserSelection, boolean allowDownload, boolean mandatoryEmail, SecurityGroup aSecurityGroup) {
this.securityGroup = aSecurityGroup;
this.mayModifyMembers = mayModifyMembers;
this.keepAtLeastOne = keepAtLeastOne;
this.mandatoryEmail = mandatoryEmail;
securityManager = BaseSecurityManager.getInstance();
imModule = CoreSpringFactory.getImpl(InstantMessagingModule.class);
imService = CoreSpringFactory.getImpl(InstantMessagingService.class);
userManager = CoreSpringFactory.getImpl(UserManager.class);
sessionManager = CoreSpringFactory.getImpl(UserSessionManager.class);
mailManager = CoreSpringFactory.getImpl(MailManager.class);
Roles roles = ureq.getUserSession().getRoles();
BaseSecurityModule securityModule = CoreSpringFactory.getImpl(BaseSecurityModule.class);
isAdministrativeUser = securityModule.isUserAllowedAdminProps(roles);
chatEnabled = imModule.isEnabled() && imModule.isPrivateEnabled();
// default group controller has no mail functionality
this.addUserMailDefaultTempl = null;
this.removeUserMailDefaultTempl = null;
groupmemberview = createVelocityContainer("index");
addUsersButton = LinkFactory.createButtonSmall("overview.addusers", groupmemberview, this);
addUsersButton.setElementCssClass("o_sel_group_import_users");
addUserButton = LinkFactory.createButtonSmall("overview.adduser", groupmemberview, this);
addUserButton.setElementCssClass("o_sel_group_add_user");
if (mayModifyMembers) {
groupmemberview.contextPut("mayadduser", Boolean.TRUE);
}
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setDownloadOffered(allowDownload);
if (enableTablePreferences) {
// save table preferences for each group seperatly
if (mayModifyMembers) {
tableConfig.setPreferencesOffered(true, "groupcontroller" + securityGroup.getKey());
} else {
// different rowcount...
tableConfig.setPreferencesOffered(true, "groupcontrollerreadonly" + securityGroup.getKey());
}
}
myTrans = userManager.getPropertyHandlerTranslator(getTranslator());
tableCtr = new TableController(tableConfig, ureq, getWindowControl(), myTrans);
listenTo(tableCtr);
initGroupTable(tableCtr, ureq, enableTablePreferences, enableUserSelection);
// set data model
reloadData();
groupmemberview.put("subjecttable", tableCtr.getInitialComponent());
putInitialPanel(groupmemberview);
}
use of org.olat.core.gui.components.table.TableGuiConfiguration in project OpenOLAT by OpenOLAT.
the class AdvancedPropertiesController method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
public void event(UserRequest ureq, Controller source, Event event) {
if (source == searchForm && event == Event.DONE_EVENT) {
String resourceTypeName = searchForm.getResourceTypeName();
String resourceTypeId = searchForm.getResourceTypeId();
Long resTypeId = null;
if (resourceTypeId != null && !resourceTypeId.equals(""))
resTypeId = Long.valueOf(resourceTypeId);
String category = searchForm.getCategory();
if (category != null && category.equals(""))
category = null;
String propertyName = searchForm.getPropertyName();
if (propertyName != null && propertyName.equals(""))
propertyName = null;
List<Property> entries = PropertyManager.getInstance().listProperties(searchForm.getIdentity(), null, resourceTypeName, resTypeId, category, propertyName);
PropertiesTableDataModel ptdm = new PropertiesTableDataModel(entries, isAdministrativeUser);
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
removeAsListenerAndDispose(tableCtr);
tableCtr = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
// use null as listener argument because we are using listenTo(..) from basiccontroller
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.userName", 0, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.resourceTypeName", 1, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.resourceTypeId", 2, null, getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.category", 3, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.name", 4, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.floatValue", 5, null, getLocale(), ColumnDescriptor.ALIGNMENT_RIGHT));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.stringValue", 6, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.longValue", 10, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.textValue", 7, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.creationdate", 8, null, getLocale()));
tableCtr.addColumnDescriptor(new DefaultColumnDescriptor("table.header.lastmodified", 9, null, getLocale()));
tableCtr.setTableDataModel(ptdm);
listenTo(tableCtr);
myPanel.setContent(tableCtr.getInitialComponent());
}
}
use of org.olat.core.gui.components.table.TableGuiConfiguration in project OpenOLAT by OpenOLAT.
the class ReadyToDeleteController method initializeTableController.
private void initializeTableController(UserRequest ureq) {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setTableEmptyMessage(translate("error.no.user.found"));
tableConfig.setShowAllLinkEnabled(false);
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, getLocale(), isAdministrativeUser);
tdm.addColumnDescriptors(tableCtr, null, "table.identity.deleteEmail");
tableCtr.addColumnDescriptor(new StaticColumnDescriptor(ACTION_SINGLESELECT_CHOOSE, "table.header.action", translate("action.activate")));
tableCtr.addMultiSelectAction("action.ready.to.delete", ACTION_MULTISELECT_CHOOSE);
tableCtr.setMultiSelect(true);
tableCtr.setTableDataModel(tdm);
}
use of org.olat.core.gui.components.table.TableGuiConfiguration in project OpenOLAT by OpenOLAT.
the class GroupController method init.
protected void init(UserRequest ureq, boolean mayModifyMembers, boolean enableTablePreferences, boolean enableUserSelection, boolean allowDownload) {
setTranslator(Util.createPackageTranslator(org.olat.admin.securitygroup.gui.GroupController.class, getLocale(), getTranslator()));
Roles roles = ureq.getUserSession().getRoles();
BaseSecurityModule securityModule = CoreSpringFactory.getImpl(BaseSecurityModule.class);
isAdministrativeUser = securityModule.isUserAllowedAdminProps(roles);
chatEnabled = imModule.isEnabled() && imModule.isPrivateEnabled();
// default group controller has no mail functionality
this.addUserMailDefaultTempl = null;
this.removeUserMailDefaultTempl = null;
groupmemberview = createVelocityContainer("index");
addUsersButton = LinkFactory.createButtonSmall("overview.addusers", groupmemberview, this);
addUsersButton.setElementCssClass("o_sel_group_import_users");
addUserButton = LinkFactory.createButtonSmall("overview.adduser", groupmemberview, this);
addUserButton.setElementCssClass("o_sel_group_add_user");
if (mayModifyMembers) {
groupmemberview.contextPut("mayadduser", Boolean.TRUE);
}
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setDownloadOffered(allowDownload);
if (enableTablePreferences) {
// save table preferences for each group seperatly
if (mayModifyMembers) {
tableConfig.setPreferencesOffered(true, "groupcontroller" + group.getKey());
} else {
// different rowcount...
tableConfig.setPreferencesOffered(true, "groupcontrollerreadonly" + group.getKey());
}
}
myTrans = userManager.getPropertyHandlerTranslator(getTranslator());
tableCtr = new TableController(tableConfig, ureq, getWindowControl(), myTrans);
listenTo(tableCtr);
initGroupTable(tableCtr, ureq, enableTablePreferences, enableUserSelection);
// set data model
reloadData();
groupmemberview.put("subjecttable", tableCtr.getInitialComponent());
putInitialPanel(groupmemberview);
}
use of org.olat.core.gui.components.table.TableGuiConfiguration in project OpenOLAT by OpenOLAT.
the class InfoPeekViewController method init.
private void init(UserRequest ureq) {
TableGuiConfiguration tableConfig = new TableGuiConfiguration();
tableConfig.setTableEmptyMessage(translate("peekview.noInfos"));
tableConfig.setDisplayTableHeader(false);
tableConfig.setCustomCssClass("o_portlet_table");
tableConfig.setDisplayRowCount(false);
tableConfig.setPageingEnabled(false);
tableConfig.setDownloadOffered(false);
tableConfig.setSortingEnabled(false);
removeAsListenerAndDispose(tableController);
tableController = new TableController(tableConfig, ureq, getWindowControl(), getTranslator());
tableController.addColumnDescriptor(new CustomRenderColumnDescriptor("peekview.title", 0, null, ureq.getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, new InfoNodeRenderer()));
String resSubPath = courseNode.getIdent();
List<InfoMessage> infos = infoService.loadInfoMessageByResource(ores, resSubPath, null, null, null, 0, 5);
InfosTableModel model = new InfosTableModel(infos);
tableController.setTableDataModel(model);
listenTo(tableController);
}
Aggregations