Skip to content
Snippets Groups Projects
Commit 970a6e32 authored by srosse's avatar srosse
Browse files

OO-291: customize every segment of the groups overview "My groups". Open the...

OO-291: customize every segment of the groups overview "My groups". Open the group tab after creating one.
parent f662348c
No related branches found
No related tags found
No related merge requests found
Showing
with 419 additions and 135 deletions
......@@ -64,7 +64,7 @@
<property name="navigationKey" value="MyGroups" />
<property name="actionController">
<bean class="org.olat.core.gui.control.creator.AutoCreator" scope="prototype">
<property name="className" value="org.olat.group.ui.main.BusinessGroupListController"/>
<property name="className" value="org.olat.group.ui.main.OverviewBusinessGroupListController"/>
</bean>
</property>
<property name="translationPackage" value="org.olat.group.ui.main" />
......
......@@ -281,14 +281,20 @@ abstract class AbstractBusinessGroupListController extends BasicController {
doLeave(ureq, (BusinessGroup)leaveDialogBox.getUserObject());
}
} else if (source == groupCreateController) {
BusinessGroup group = null;
if(event == Event.DONE_EVENT) {
BusinessGroup group = groupCreateController.getCreatedGroup();
group = groupCreateController.getCreatedGroup();
if(group != null) {
reload();
}
}
cmc.deactivate();
cleanUpPopups();
//if new group -> go to the tab
if(group != null) {
String businessPath = "[BusinessGroup:" + group.getKey() + "]";
NewControllerFactory.getInstance().launch(businessPath, ureq, getWindowControl());
}
} else if (source == businessGroupWizard) {
if(event == Event.CANCELLED_EVENT || event == Event.DONE_EVENT || event == Event.CHANGED_EVENT) {
getWindowControl().pop();
......
......@@ -20,19 +20,11 @@
package org.olat.group.ui.main;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.Component;
import org.olat.core.gui.components.link.Link;
import org.olat.core.gui.components.link.LinkFactory;
import org.olat.core.gui.components.segmentedview.SegmentViewComponent;
import org.olat.core.gui.components.segmentedview.SegmentViewEvent;
import org.olat.core.gui.components.segmentedview.SegmentViewFactory;
import org.olat.core.gui.components.table.BooleanColumnDescriptor;
import org.olat.core.gui.components.table.ColumnDescriptor;
import org.olat.core.gui.components.table.CustomCellRenderer;
import org.olat.core.gui.components.table.CustomRenderColumnDescriptor;
import org.olat.core.gui.components.table.DefaultColumnDescriptor;
import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl;
import org.olat.group.model.SearchBusinessGroupParams;
import org.olat.group.ui.main.BusinessGroupTableModelWithType.Cols;
......@@ -43,48 +35,13 @@ import org.olat.group.ui.main.BusinessGroupTableModelWithType.Cols;
*/
public class BusinessGroupListController extends AbstractBusinessGroupListController {
private final Link markedGroupsLink, allGroupsLink, ownedGroupsLink, searchOpenLink;
private final SegmentViewComponent segmentView;
private final BusinessGroupSearchController searchController;
public BusinessGroupListController(UserRequest ureq, WindowControl wControl) {
super(ureq, wControl, "group_list");
//search controller
searchController = new BusinessGroupSearchController(ureq, wControl, isAdmin(), true);
listenTo(searchController);
mainVC.put("search", searchController.getInitialComponent());
searchController.getInitialComponent().setVisible(false);
mainVC.put("searchPanel", searchController.getInitialComponent());
//try to fill the table with marked groups
boolean marked = updateMarkedGroups();
if(!marked) {
updateAllGroups();
}
//segmented view
segmentView = SegmentViewFactory.createSegmentView("segments", mainVC, this);
markedGroupsLink = LinkFactory.createLink("marked.groups", mainVC, this);
segmentView.addSegment(markedGroupsLink, marked);
allGroupsLink = LinkFactory.createLink("opengroups.all", mainVC, this);
segmentView.addSegment(allGroupsLink, !marked);
ownedGroupsLink = LinkFactory.createLink("owned.groups", mainVC, this);
segmentView.addSegment(ownedGroupsLink, false);
searchOpenLink = LinkFactory.createLink("opengroups.search", mainVC, this);
segmentView.addSegment(searchOpenLink, false);
}
@Override
protected void initButtons(UserRequest ureq) {
initButtons(ureq, true);
groupListCtr.setMultiSelect(true);
groupListCtr.addMultiSelectAction("table.duplicate", TABLE_ACTION_DUPLICATE);
groupListCtr.addMultiSelectAction("table.merge", TABLE_ACTION_MERGE);
groupListCtr.addMultiSelectAction("table.users.management", TABLE_ACTION_USERS);
groupListCtr.addMultiSelectAction("table.config", TABLE_ACTION_CONFIG);
groupListCtr.addMultiSelectAction("table.email", TABLE_ACTION_EMAIL);
groupListCtr.addMultiSelectAction("table.delete", TABLE_ACTION_DELETE);
}
@Override
......@@ -106,55 +63,8 @@ public class BusinessGroupListController extends AbstractBusinessGroupListContro
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.accessControlLaunch.i18n(), Cols.accessControlLaunch.ordinal(), TABLE_ACTION_ACCESS, getLocale()));
return 7;
}
@Override
protected void doDispose() {
//
}
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if(source == segmentView) {
if(event instanceof SegmentViewEvent) {
SegmentViewEvent sve = (SegmentViewEvent)event;
String segmentCName = sve.getComponentName();
Component clickedLink = mainVC.getComponent(segmentCName);
if (clickedLink ==markedGroupsLink) {
updateMarkedGroups();
} else if (clickedLink == allGroupsLink){
updateAllGroups();
} else if (clickedLink == ownedGroupsLink){
updateOwnedGroups();
} else if (clickedLink == searchOpenLink) {
doSearch(null);
}
searchController.getInitialComponent().setVisible(clickedLink == searchOpenLink);
}
}
super.event(ureq, source, event);
}
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if(source == searchController) {
if(event instanceof SearchEvent) {
doSearch((SearchEvent)event);
}
}
super.event(ureq, source, event);
}
private boolean updateMarkedGroups() {
SearchBusinessGroupParams params = new SearchBusinessGroupParams();
params.setMarked(Boolean.TRUE);
params.setAttendee(true);
params.setOwner(true);
params.setWaiting(true);
params.setIdentity(getIdentity());
return !updateTableModel(params, true).isEmpty();
}
private void updateAllGroups() {
protected void updateAllGroups() {
SearchBusinessGroupParams params = new SearchBusinessGroupParams();
params.setAttendee(true);
params.setOwner(true);
......@@ -162,37 +72,4 @@ public class BusinessGroupListController extends AbstractBusinessGroupListContro
params.setIdentity(getIdentity());
updateTableModel(params, false);
}
private void updateOwnedGroups() {
SearchBusinessGroupParams params = new SearchBusinessGroupParams();
params.setIdentity(getIdentity());
params.setOwner(true);
updateTableModel(params, false);
}
private void doSearch(SearchEvent event) {
long start = isLogDebugEnabled() ? System.currentTimeMillis() : 0;
search(event);
if(isLogDebugEnabled()) {
logDebug("Group search takes (ms): " + (System.currentTimeMillis() - start), null);
}
}
private void search(SearchEvent event) {
if(event == null) {
updateTableModel(null, false);
} else {
SearchBusinessGroupParams params = event.convertToSearchBusinessGroupParams(getIdentity());
//security
if(!params.isAttendee() && !params.isOwner() && !params.isWaiting()
&& (params.getPublicGroups() == null || !params.getPublicGroups().booleanValue())) {
params.setOwner(true);
params.setAttendee(true);
params.setWaiting(true);
}
updateTableModel(params, false);
}
}
}
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.group.ui.main;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.table.BooleanColumnDescriptor;
import org.olat.core.gui.components.table.ColumnDescriptor;
import org.olat.core.gui.components.table.CustomCellRenderer;
import org.olat.core.gui.components.table.CustomRenderColumnDescriptor;
import org.olat.core.gui.components.table.DefaultColumnDescriptor;
import org.olat.core.gui.control.WindowControl;
import org.olat.group.model.SearchBusinessGroupParams;
import org.olat.group.ui.main.BusinessGroupTableModelWithType.Cols;
/**
*
* @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
*/
public class FavoritBusinessGroupListController extends AbstractBusinessGroupListController {
public FavoritBusinessGroupListController(UserRequest ureq, WindowControl wControl) {
super(ureq, wControl, "group_list");
}
@Override
protected void initButtons(UserRequest ureq) {
initButtons(ureq, true);
}
@Override
protected int initColumns() {
CustomCellRenderer markRenderer = new BGMarkCellRenderer(this, mainVC, getTranslator());
groupListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor(Cols.mark.i18n(), Cols.resources.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, markRenderer));
CustomCellRenderer acRenderer = new BGAccessControlledCellRenderer();
groupListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor(Cols.accessTypes.i18n(), Cols.accessTypes.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, acRenderer));
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.name.i18n(), Cols.name.ordinal(), TABLE_ACTION_LAUNCH, getLocale()));
groupListCtr.addColumnDescriptor(false, new DefaultColumnDescriptor(Cols.description.i18n(), Cols.description.ordinal(), null, getLocale()));
CustomCellRenderer resourcesRenderer = new BGResourcesCellRenderer(this, mainVC, getTranslator());
groupListCtr.addColumnDescriptor(false, new CustomRenderColumnDescriptor(Cols.resources.i18n(), Cols.resources.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, resourcesRenderer));
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.firstTime.i18n(), Cols.firstTime.ordinal(), null, getLocale()));
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.lastTime.i18n(), Cols.lastTime.ordinal(), null, getLocale()));
groupListCtr.addColumnDescriptor(false, new DefaultColumnDescriptor(Cols.lastUsage.i18n(), Cols.lastUsage.ordinal(), null, getLocale()));
CustomCellRenderer roleRenderer = new BGRoleCellRenderer(getLocale());
groupListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor(Cols.role.i18n(), Cols.role.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, roleRenderer));
groupListCtr.addColumnDescriptor(false, new BooleanColumnDescriptor(Cols.allowLeave.i18n(), Cols.allowLeave.ordinal(), TABLE_ACTION_LEAVE, translate("table.header.leave"), null));
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.accessControlLaunch.i18n(), Cols.accessControlLaunch.ordinal(), TABLE_ACTION_ACCESS, getLocale()));
return 7;
}
protected boolean updateMarkedGroups() {
SearchBusinessGroupParams params = new SearchBusinessGroupParams();
params.setMarked(Boolean.TRUE);
params.setAttendee(true);
params.setOwner(true);
params.setWaiting(true);
params.setIdentity(getIdentity());
return !updateTableModel(params, true).isEmpty();
}
}
package org.olat.group.ui.main;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.Component;
import org.olat.core.gui.components.link.Link;
import org.olat.core.gui.components.link.LinkFactory;
import org.olat.core.gui.components.segmentedview.SegmentViewComponent;
import org.olat.core.gui.components.segmentedview.SegmentViewEvent;
import org.olat.core.gui.components.segmentedview.SegmentViewFactory;
import org.olat.core.gui.components.velocity.VelocityContainer;
import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.controller.BasicController;
/**
*
*
*
*
* @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
*/
public class OverviewBusinessGroupListController extends BasicController {
private final Link markedGroupsLink, allGroupsLink, ownedGroupsLink, searchOpenLink;
private final SegmentViewComponent segmentView;
private final VelocityContainer mainVC;
private FavoritBusinessGroupListController favoritGroupsCtrl;
private BusinessGroupListController allGroupsCtrl;
private OwnedBusinessGroupListController ownedGroupsCtrl;
private SearchBusinessGroupListController searchGroupsCtrl;
public OverviewBusinessGroupListController(UserRequest ureq, WindowControl wControl) {
super(ureq, wControl);
mainVC = createVelocityContainer("group_list_overview");
boolean marked = updateMarkedGroups(ureq);
if(!marked) {
updateAllGroups(ureq);
}
//segmented view
segmentView = SegmentViewFactory.createSegmentView("segments", mainVC, this);
markedGroupsLink = LinkFactory.createLink("marked.groups", mainVC, this);
segmentView.addSegment(markedGroupsLink, marked);
allGroupsLink = LinkFactory.createLink("opengroups.all", mainVC, this);
segmentView.addSegment(allGroupsLink, !marked);
ownedGroupsLink = LinkFactory.createLink("owned.groups", mainVC, this);
segmentView.addSegment(ownedGroupsLink, false);
searchOpenLink = LinkFactory.createLink("opengroups.search", mainVC, this);
segmentView.addSegment(searchOpenLink, false);
putInitialPanel(mainVC);
}
@Override
protected void event(UserRequest ureq, Component source, Event event) {
if(source == segmentView) {
if(event instanceof SegmentViewEvent) {
SegmentViewEvent sve = (SegmentViewEvent)event;
String segmentCName = sve.getComponentName();
Component clickedLink = mainVC.getComponent(segmentCName);
if (clickedLink == markedGroupsLink) {
updateMarkedGroups(ureq);
} else if (clickedLink == allGroupsLink){
updateAllGroups(ureq);
} else if (clickedLink == ownedGroupsLink){
updateOwnedGroups(ureq);
} else if (clickedLink == searchOpenLink) {
doSearch(ureq, null);
}
}
}
}
@Override
protected void doDispose() {
//
}
private boolean updateMarkedGroups(UserRequest ureq) {
if(favoritGroupsCtrl == null) {
favoritGroupsCtrl = new FavoritBusinessGroupListController(ureq, getWindowControl());
}
boolean hasMark = favoritGroupsCtrl.updateMarkedGroups();
mainVC.put("groupList", favoritGroupsCtrl.getInitialComponent());
return hasMark;
}
private void updateAllGroups(UserRequest ureq) {
if(allGroupsCtrl == null) {
allGroupsCtrl = new BusinessGroupListController(ureq, getWindowControl());
}
allGroupsCtrl.updateAllGroups();
mainVC.put("groupList", allGroupsCtrl.getInitialComponent());
}
private void updateOwnedGroups(UserRequest ureq) {
if(ownedGroupsCtrl == null) {
ownedGroupsCtrl = new OwnedBusinessGroupListController(ureq, getWindowControl());
}
ownedGroupsCtrl.updateOwnedGroups();
mainVC.put("groupList", ownedGroupsCtrl.getInitialComponent());
}
private void doSearch(UserRequest ureq, Object obj) {
if(searchGroupsCtrl == null) {
searchGroupsCtrl = new SearchBusinessGroupListController(ureq, getWindowControl());
}
searchGroupsCtrl.updateSearch();
mainVC.put("groupList", searchGroupsCtrl.getInitialComponent());
}
}
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.group.ui.main;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.table.BooleanColumnDescriptor;
import org.olat.core.gui.components.table.ColumnDescriptor;
import org.olat.core.gui.components.table.CustomCellRenderer;
import org.olat.core.gui.components.table.CustomRenderColumnDescriptor;
import org.olat.core.gui.components.table.DefaultColumnDescriptor;
import org.olat.core.gui.control.WindowControl;
import org.olat.group.model.SearchBusinessGroupParams;
import org.olat.group.ui.main.BusinessGroupTableModelWithType.Cols;
/**
*
* @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
*/
public class OwnedBusinessGroupListController extends AbstractBusinessGroupListController {
public OwnedBusinessGroupListController(UserRequest ureq, WindowControl wControl) {
super(ureq, wControl, "group_list");
}
@Override
protected void initButtons(UserRequest ureq) {
initButtons(ureq, true);
groupListCtr.setMultiSelect(true);
groupListCtr.addMultiSelectAction("table.duplicate", TABLE_ACTION_DUPLICATE);
groupListCtr.addMultiSelectAction("table.merge", TABLE_ACTION_MERGE);
groupListCtr.addMultiSelectAction("table.users.management", TABLE_ACTION_USERS);
groupListCtr.addMultiSelectAction("table.config", TABLE_ACTION_CONFIG);
groupListCtr.addMultiSelectAction("table.email", TABLE_ACTION_EMAIL);
groupListCtr.addMultiSelectAction("table.delete", TABLE_ACTION_DELETE);
}
@Override
protected int initColumns() {
CustomCellRenderer markRenderer = new BGMarkCellRenderer(this, mainVC, getTranslator());
groupListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor(Cols.mark.i18n(), Cols.resources.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, markRenderer));
CustomCellRenderer acRenderer = new BGAccessControlledCellRenderer();
groupListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor(Cols.accessTypes.i18n(), Cols.accessTypes.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, acRenderer));
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.name.i18n(), Cols.name.ordinal(), TABLE_ACTION_LAUNCH, getLocale()));
groupListCtr.addColumnDescriptor(false, new DefaultColumnDescriptor(Cols.description.i18n(), Cols.description.ordinal(), null, getLocale()));
CustomCellRenderer resourcesRenderer = new BGResourcesCellRenderer(this, mainVC, getTranslator());
groupListCtr.addColumnDescriptor(false, new CustomRenderColumnDescriptor(Cols.resources.i18n(), Cols.resources.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, resourcesRenderer));
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.firstTime.i18n(), Cols.firstTime.ordinal(), null, getLocale()));
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.lastTime.i18n(), Cols.lastTime.ordinal(), null, getLocale()));
groupListCtr.addColumnDescriptor(false, new DefaultColumnDescriptor(Cols.lastUsage.i18n(), Cols.lastUsage.ordinal(), null, getLocale()));
CustomCellRenderer roleRenderer = new BGRoleCellRenderer(getLocale());
groupListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor(Cols.role.i18n(), Cols.role.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, roleRenderer));
groupListCtr.addColumnDescriptor(false, new BooleanColumnDescriptor(Cols.allowLeave.i18n(), Cols.allowLeave.ordinal(), TABLE_ACTION_LEAVE, translate("table.header.leave"), null));
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.accessControlLaunch.i18n(), Cols.accessControlLaunch.ordinal(), TABLE_ACTION_ACCESS, getLocale()));
return 7;
}
protected void updateOwnedGroups() {
SearchBusinessGroupParams params = new SearchBusinessGroupParams();
params.setIdentity(getIdentity());
params.setOwner(true);
updateTableModel(params, false);
}
}
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
* <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
* <p>
* Unless required by applicable law or agreed to in writing,<br>
* software distributed under the License is distributed on an "AS IS" BASIS, <br>
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
* See the License for the specific language governing permissions and <br>
* limitations under the License.
* <p>
* Initial code contributed and copyrighted by<br>
* frentix GmbH, http://www.frentix.com
* <p>
*/
package org.olat.group.ui.main;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.table.BooleanColumnDescriptor;
import org.olat.core.gui.components.table.ColumnDescriptor;
import org.olat.core.gui.components.table.CustomCellRenderer;
import org.olat.core.gui.components.table.CustomRenderColumnDescriptor;
import org.olat.core.gui.components.table.DefaultColumnDescriptor;
import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.Event;
import org.olat.core.gui.control.WindowControl;
import org.olat.group.model.SearchBusinessGroupParams;
import org.olat.group.ui.main.BusinessGroupTableModelWithType.Cols;
/**
*
* @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
*/
public class SearchBusinessGroupListController extends AbstractBusinessGroupListController {
private final BusinessGroupSearchController searchController;
public SearchBusinessGroupListController(UserRequest ureq, WindowControl wControl) {
super(ureq, wControl, "group_list_search");
//search controller
searchController = new BusinessGroupSearchController(ureq, wControl, isAdmin(), true);
listenTo(searchController);
mainVC.put("search", searchController.getInitialComponent());
}
@Override
protected void initButtons(UserRequest ureq) {
initButtons(ureq, true);
groupListCtr.setMultiSelect(true);
groupListCtr.addMultiSelectAction("table.duplicate", TABLE_ACTION_DUPLICATE);
groupListCtr.addMultiSelectAction("table.merge", TABLE_ACTION_MERGE);
groupListCtr.addMultiSelectAction("table.users.management", TABLE_ACTION_USERS);
groupListCtr.addMultiSelectAction("table.config", TABLE_ACTION_CONFIG);
groupListCtr.addMultiSelectAction("table.email", TABLE_ACTION_EMAIL);
groupListCtr.addMultiSelectAction("table.delete", TABLE_ACTION_DELETE);
}
@Override
protected int initColumns() {
CustomCellRenderer markRenderer = new BGMarkCellRenderer(this, mainVC, getTranslator());
groupListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor(Cols.mark.i18n(), Cols.resources.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, markRenderer));
CustomCellRenderer acRenderer = new BGAccessControlledCellRenderer();
groupListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor(Cols.accessTypes.i18n(), Cols.accessTypes.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, acRenderer));
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.name.i18n(), Cols.name.ordinal(), TABLE_ACTION_LAUNCH, getLocale()));
groupListCtr.addColumnDescriptor(false, new DefaultColumnDescriptor(Cols.description.i18n(), Cols.description.ordinal(), null, getLocale()));
CustomCellRenderer resourcesRenderer = new BGResourcesCellRenderer(this, mainVC, getTranslator());
groupListCtr.addColumnDescriptor(false, new CustomRenderColumnDescriptor(Cols.resources.i18n(), Cols.resources.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, resourcesRenderer));
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.firstTime.i18n(), Cols.firstTime.ordinal(), null, getLocale()));
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.lastTime.i18n(), Cols.lastTime.ordinal(), null, getLocale()));
groupListCtr.addColumnDescriptor(false, new DefaultColumnDescriptor(Cols.lastUsage.i18n(), Cols.lastUsage.ordinal(), null, getLocale()));
CustomCellRenderer roleRenderer = new BGRoleCellRenderer(getLocale());
groupListCtr.addColumnDescriptor(new CustomRenderColumnDescriptor(Cols.role.i18n(), Cols.role.ordinal(), null, getLocale(), ColumnDescriptor.ALIGNMENT_LEFT, roleRenderer));
groupListCtr.addColumnDescriptor(false, new BooleanColumnDescriptor(Cols.allowLeave.i18n(), Cols.allowLeave.ordinal(), TABLE_ACTION_LEAVE, translate("table.header.leave"), null));
groupListCtr.addColumnDescriptor(new DefaultColumnDescriptor(Cols.accessControlLaunch.i18n(), Cols.accessControlLaunch.ordinal(), TABLE_ACTION_ACCESS, getLocale()));
return 7;
}
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if(source == searchController) {
if(event instanceof SearchEvent) {
doSearch((SearchEvent)event);
}
}
super.event(ureq, source, event);
}
protected void updateSearch() {
doSearch(null);
}
private void doSearch(SearchEvent event) {
long start = isLogDebugEnabled() ? System.currentTimeMillis() : 0;
search(event);
if(isLogDebugEnabled()) {
logDebug("Group search takes (ms): " + (System.currentTimeMillis() - start), null);
}
}
private void search(SearchEvent event) {
if(event == null) {
updateTableModel(null, false);
} else {
SearchBusinessGroupParams params = event.convertToSearchBusinessGroupParams(getIdentity());
//security
if(!params.isAttendee() && !params.isOwner() && !params.isWaiting()
&& (params.getPublicGroups() == null || !params.getPublicGroups().booleanValue())) {
params.setOwner(true);
params.setAttendee(true);
params.setWaiting(true);
}
updateTableModel(params, false);
}
}
}
<h4 class="b_with_small_icon_left b_group_icon">
$r.translate("menu.groups")
</h4>
<div class="b_clearfix">
$r.render("segments") <br/>
#if($r.available("search"))
$r.render("search")
#end
$r.render("groupList")
</div>
#if($r.available("create.group"))
......
<h4 class="b_with_small_icon_left b_group_icon">
$r.translate("menu.groups")
</h4>
<div class="b_clearfix">
$r.render("segments")<br/>
$r.render("groupList")
</div>
\ No newline at end of file
<div class="b_clearfix">
$r.render("search")
$r.render("groupList")
</div>
#if($r.available("create.group"))
<div class="b_clearfix">
<p>$r.translate("create.group.description")</p>
$r.render("create.group")
</div>
#end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment