From ab4b9e8c87e98bc27e4662fa1ee6a5474a4e7792 Mon Sep 17 00:00:00 2001 From: srosse <none@none> Date: Tue, 3 Dec 2013 14:10:59 +0100 Subject: [PATCH] OO-884: implement table controlled by user property context for the cehcklist --- .../bps/course/nodes/ChecklistCourseNode.java | 15 ++- .../cl/ChecklistDisplayController.java | 13 +- .../ChecklistEditCheckpointsController.java | 1 - .../bps/olat/modules/cl/ChecklistFilter.java | 41 ------- .../ChecklistManageCheckpointsController.java | 62 +++++++--- .../cl/ChecklistManageTableDataModel.java | 113 ++++++++++++------ .../cl/ChecklistRunTableDataModel.java | 4 +- .../olat/modules/cl/ChecklistUIFactory.java | 10 +- .../_spring/userPropertiesContext.xml | 31 +++++ 9 files changed, 173 insertions(+), 117 deletions(-) delete mode 100644 src/main/java/de/bps/olat/modules/cl/ChecklistFilter.java diff --git a/src/main/java/de/bps/course/nodes/ChecklistCourseNode.java b/src/main/java/de/bps/course/nodes/ChecklistCourseNode.java index 022e1c8c3d4..d14a9b6ff17 100644 --- a/src/main/java/de/bps/course/nodes/ChecklistCourseNode.java +++ b/src/main/java/de/bps/course/nodes/ChecklistCourseNode.java @@ -182,11 +182,18 @@ public class ChecklistCourseNode extends AbstractAccessableCourseNode { UserCourseEnvironment userCourseEnv, NodeEvaluation ne, String nodecmd) { ICourse course = CourseFactory.loadCourse(userCourseEnv.getCourseEnvironment().getCourseResourceableId()); CourseGroupManager cgm = course.getCourseEnvironment().getCourseGroupManager(); - boolean canEdit = ureq.getUserSession().getRoles().isOLATAdmin() || cgm.isIdentityCourseAdministrator(ureq.getIdentity()); + boolean canEdit = ureq.getUserSession().getRoles().isOLATAdmin() + || cgm.isIdentityCourseAdministrator(ureq.getIdentity()); boolean canManage; - if(canEdit) canManage = true; - else canManage = cgm.isIdentityCourseCoach(ureq.getIdentity()) | cgm.hasRight(ureq.getIdentity(), CourseRights.RIGHT_GROUPMANAGEMENT); - Controller controller = ChecklistUIFactory.getInstance().createDisplayController(ureq, wControl, loadOrCreateChecklist(userCourseEnv.getCourseEnvironment().getCoursePropertyManager()), null, canEdit, canManage, course, this); + if(canEdit) { + canManage = true; + } else { + canManage = cgm.isIdentityCourseCoach(ureq.getIdentity()) + || cgm.hasRight(ureq.getIdentity(), CourseRights.RIGHT_GROUPMANAGEMENT); + } + Checklist checklist = loadOrCreateChecklist(userCourseEnv.getCourseEnvironment().getCoursePropertyManager()); + Controller controller = ChecklistUIFactory.getInstance() + .createDisplayController(ureq, wControl, checklist, canEdit, canManage, course, this); // Add title and descrition controller = TitledWrapperHelper.getWrapper(ureq, wControl, controller, this, "o_cl_icon"); return new NodeRunConstructionResult(controller); diff --git a/src/main/java/de/bps/olat/modules/cl/ChecklistDisplayController.java b/src/main/java/de/bps/olat/modules/cl/ChecklistDisplayController.java index 943075fa448..9b56ea136ce 100644 --- a/src/main/java/de/bps/olat/modules/cl/ChecklistDisplayController.java +++ b/src/main/java/de/bps/olat/modules/cl/ChecklistDisplayController.java @@ -71,28 +71,26 @@ public class ChecklistDisplayController extends BasicController { private Controller manageController, editController; // data - private List<ChecklistFilter> filter; private Checklist checklist; private ICourse course; private List<Checkpoint> visibleCheckpoints; private ChecklistRunTableDataModel runTableData; private BitSet selection; - protected ChecklistDisplayController(UserRequest ureq, WindowControl wControl, Checklist checklist, List<ChecklistFilter> filter, boolean canEdit, boolean canManage, ICourse course) { + protected ChecklistDisplayController(UserRequest ureq, WindowControl wControl, Checklist checklist, boolean canEdit, boolean canManage, ICourse course) { super(ureq, wControl); // initialize attributes this.checklist = checklist; this.course = course; - this.filter = filter; this.canEdit = canEdit; this.canManage = canManage; this.visibleCheckpoints = checklist.getVisibleCheckpoints(); // display checklist - displayChecklist(ureq, wControl); + displayChecklist(ureq); } - private void displayChecklist(UserRequest ureq, WindowControl wControl) { + private void displayChecklist(UserRequest ureq) { // add title VelocityContainer displayChecklistVC = this.createVelocityContainer("display"); @@ -334,7 +332,6 @@ class ChecklistAuthorOptionsForm extends FormBasicController { } @Override - @SuppressWarnings("unused") protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) { FormLayoutContainer mainLayout = FormLayoutContainer.createHorizontalFormLayout("mainLayout", getTranslator()); formLayout.add(mainLayout); @@ -348,7 +345,7 @@ class ChecklistAuthorOptionsForm extends FormBasicController { } @Override - protected void formInnerEvent(UserRequest ureq, FormItem source, @SuppressWarnings("unused") FormEvent event) { + protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) { if(source == manageCheckpointsBtn) { fireEvent(ureq, MANAGE_CHECKPOINT); } else if(source == configCheckpointsBtn) { @@ -362,7 +359,7 @@ class ChecklistAuthorOptionsForm extends FormBasicController { } @Override - protected void formOK(@SuppressWarnings("unused") UserRequest ureq) { + protected void formOK(UserRequest ureq) { // nothing to do } diff --git a/src/main/java/de/bps/olat/modules/cl/ChecklistEditCheckpointsController.java b/src/main/java/de/bps/olat/modules/cl/ChecklistEditCheckpointsController.java index 4ed2bc8f76e..41a393be20b 100644 --- a/src/main/java/de/bps/olat/modules/cl/ChecklistEditCheckpointsController.java +++ b/src/main/java/de/bps/olat/modules/cl/ChecklistEditCheckpointsController.java @@ -210,7 +210,6 @@ public class ChecklistEditCheckpointsController extends FormBasicController { } @Override - @SuppressWarnings("unused") protected void initForm(FormItemContainer fic, Controller controller, UserRequest ureq) { if(titleContainer != null) fic.remove(titleContainer); if(buttonContainer != null) fic.remove(buttonContainer); diff --git a/src/main/java/de/bps/olat/modules/cl/ChecklistFilter.java b/src/main/java/de/bps/olat/modules/cl/ChecklistFilter.java deleted file mode 100644 index ed555bb8a57..00000000000 --- a/src/main/java/de/bps/olat/modules/cl/ChecklistFilter.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * <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> - * BPS Bildungsportal Sachsen GmbH, http://www.bps-system.de - * <p> - */ -package de.bps.olat.modules.cl; - -import java.util.List; - -/** - * Description:<br> - * TODO: bja Class Description for ChecklistFilter - * - * <P> - * Initial Date: 23.07.2009 <br> - * @author bja <bja@bps-system.de> - */ -public class ChecklistFilter { - - private String title; - private List<Long> identityIds; - - public ChecklistFilter(String title, List<Long> identityIds) { - this.title = title; - this.identityIds = identityIds; - } -} diff --git a/src/main/java/de/bps/olat/modules/cl/ChecklistManageCheckpointsController.java b/src/main/java/de/bps/olat/modules/cl/ChecklistManageCheckpointsController.java index 74a7f39cddd..66e52b7c58c 100644 --- a/src/main/java/de/bps/olat/modules/cl/ChecklistManageCheckpointsController.java +++ b/src/main/java/de/bps/olat/modules/cl/ChecklistManageCheckpointsController.java @@ -23,9 +23,11 @@ import java.util.ArrayList; import java.util.BitSet; import java.util.HashSet; import java.util.List; +import java.util.Set; import org.olat.basesecurity.BaseSecurity; import org.olat.basesecurity.BaseSecurityManager; +import org.olat.basesecurity.BaseSecurityModule; import org.olat.core.CoreSpringFactory; import org.olat.core.gui.UserRequest; import org.olat.core.gui.components.Component; @@ -39,9 +41,9 @@ import org.olat.core.gui.components.form.flexible.impl.FormLayoutContainer; import org.olat.core.gui.components.link.Link; import org.olat.core.gui.components.link.LinkFactory; import org.olat.core.gui.components.panel.Panel; -import org.olat.core.gui.components.table.BooleanColumnDescriptor; import org.olat.core.gui.components.table.ColumnDescriptor; import org.olat.core.gui.components.table.DefaultColumnDescriptor; +import org.olat.core.gui.components.table.StaticColumnDescriptor; import org.olat.core.gui.components.table.Table; import org.olat.core.gui.components.table.TableController; import org.olat.core.gui.components.table.TableEvent; @@ -58,6 +60,7 @@ import org.olat.core.gui.render.StringOutput; import org.olat.core.id.Identity; import org.olat.core.id.UserConstants; import org.olat.core.util.StringHelper; +import org.olat.core.util.Util; import org.olat.course.ICourse; import org.olat.course.groupsandrights.CourseGroupManager; import org.olat.course.groupsandrights.CourseRights; @@ -65,6 +68,7 @@ import org.olat.group.BusinessGroup; import org.olat.group.BusinessGroupService; import org.olat.user.UserInfoMainController; import org.olat.user.UserManager; +import org.olat.user.propertyhandlers.UserPropertyHandler; /** * Description:<br> @@ -79,6 +83,7 @@ public class ChecklistManageCheckpointsController extends BasicController { protected final static String EDIT_ACTION = "cl.edit.identity"; protected final static String DETAILS_ACTION = "cl.user.details"; + protected static final String USER_PROPS_ID = ChecklistManageCheckpointsController.class.getCanonicalName(); private Identity selectedIdentity; @@ -97,31 +102,35 @@ public class ChecklistManageCheckpointsController extends BasicController { private List<BusinessGroup> lstGroups; private List<Identity> allIdentities, notInGroupIdentities; private CourseGroupManager cgm; + private final UserManager userManager; private final BaseSecurity securityManager; + private final BaseSecurityModule securityModule; private final BusinessGroupService businessGroupService; private CloseableModalController cmcUserInfo; private UserInfoMainController uimc; protected ChecklistManageCheckpointsController(UserRequest ureq, WindowControl wControl, Checklist checklist, ICourse course) { - super(ureq, wControl); + super(ureq, wControl, Util.createPackageTranslator(UserPropertyHandler.class, ureq.getLocale())); this.checklist = checklist; this.course = course; this.allIdentities = new ArrayList<Identity>(); this.notInGroupIdentities = new ArrayList<Identity>(); this.lstGroups = new ArrayList<BusinessGroup>(); - businessGroupService = CoreSpringFactory.getImpl(BusinessGroupService.class); securityManager = BaseSecurityManager.getInstance(); + userManager = CoreSpringFactory.getImpl(UserManager.class); + securityModule = CoreSpringFactory.getImpl(BaseSecurityModule.class); + businessGroupService = CoreSpringFactory.getImpl(BusinessGroupService.class); loadData(); cgm = course.getCourseEnvironment().getCourseGroupManager(); Identity identity = ureq.getIdentity(); boolean isAdmin = ureq.getUserSession().getRoles().isOLATAdmin() || cgm.isIdentityCourseAdministrator(identity); - if(cgm.isIdentityCourseAdministrator(identity)) { + if(isAdmin) { // collect all identities with results - HashSet<Identity> identitiesWithResult = new HashSet<Identity>(); + Set<Identity> identitiesWithResult = new HashSet<>(); for( Checkpoint checkpoint : this.checklist.getCheckpoints() ) { for( CheckpointResult result : checkpoint.getResults() ) { identitiesWithResult.add(securityManager.loadIdentityByKey(result.getIdentityId())); @@ -129,19 +138,19 @@ public class ChecklistManageCheckpointsController extends BasicController { } // collect all identities in learning groups - HashSet<Identity> identitiesInGroups = new HashSet<Identity>(); + Set<Identity> identitiesInGroups = new HashSet<>(); identitiesInGroups.addAll(cgm.getParticipantsFromBusinessGroups()); //fxdiff VCRP-1,2: access control of resources identitiesInGroups.addAll(cgm.getParticipants()); // all identities with result and/or in learning groups - HashSet<Identity> identitiesAll = new HashSet<Identity>(); + Set<Identity> identitiesAll = new HashSet<Identity>(); identitiesAll.addAll(identitiesInGroups); identitiesAll.addAll(identitiesWithResult); allIdentities.addAll(identitiesAll); // collect all identities not in any learning group - HashSet<Identity> identitiesNotInGroups = new HashSet<Identity>(); + Set<Identity> identitiesNotInGroups = new HashSet<>(); identitiesNotInGroups.addAll(identitiesAll); identitiesNotInGroups.removeAll(identitiesInGroups); notInGroupIdentities.addAll(identitiesNotInGroups); @@ -150,7 +159,7 @@ public class ChecklistManageCheckpointsController extends BasicController { lstGroups.addAll(cgm.getAllBusinessGroups()); } else if(cgm.hasRight(identity, CourseRights.RIGHT_GROUPMANAGEMENT)) { // collect all identities in learning groups - HashSet<Identity> identitiesInGroups = new HashSet<Identity>(); + Set<Identity> identitiesInGroups = new HashSet<>(); identitiesInGroups.addAll(cgm.getParticipantsFromBusinessGroups()); //fxdiff VCRP-1,2: access control of resources identitiesInGroups.addAll(cgm.getParticipants()); @@ -159,7 +168,7 @@ public class ChecklistManageCheckpointsController extends BasicController { // collect all learning groups lstGroups.addAll(cgm.getAllBusinessGroups()); } else if(cgm.isIdentityCourseCoach(identity)) { - HashSet<Identity> identitiesInGroups = new HashSet<Identity>(); + Set<Identity> identitiesInGroups = new HashSet<>(); for( BusinessGroup group : cgm.getAllBusinessGroups() ) { if(securityManager.isIdentityInSecurityGroup(identity, group.getOwnerGroup())) { lstGroups.add(group); @@ -211,10 +220,10 @@ public class ChecklistManageCheckpointsController extends BasicController { BusinessGroup group = businessGroupService.loadBusinessGroup(groupKey); lstIdents.addAll(securityManager.getIdentitiesOfSecurityGroup(group.getPartipiciantGroup())); } + boolean isAdministrativeUser = securityModule.isUserAllowedAdminProps(ureq.getUserSession().getRoles()); + List<UserPropertyHandler> userPropertyHandlers = userManager.getUserPropertyHandlersFor(USER_PROPS_ID, isAdministrativeUser); // prepare table for run view - manageTableData = new ChecklistManageTableDataModel(this.checklist, lstIdents); - TableGuiConfiguration tableConfig = new TableGuiConfiguration(); tableConfig.setTableEmptyMessage(translate("cl.table.empty")); tableConfig.setColumnMovingOffered(true); @@ -225,15 +234,31 @@ public class ChecklistManageCheckpointsController extends BasicController { manageChecklistTable = new TableController(tableConfig, ureq, getWindowControl(), getTranslator()); listenTo(manageChecklistTable); - manageChecklistTable.addColumnDescriptor(new DefaultColumnDescriptor("cl.table.identity", 0, DETAILS_ACTION, ureq.getLocale())); - int i = 1; + int cols = 0; + if(isAdministrativeUser) { + manageChecklistTable.addColumnDescriptor(new DefaultColumnDescriptor("username", 1000, null, getLocale())); + cols++; + } + + int i=0; + for (UserPropertyHandler userPropertyHandler : userPropertyHandlers) { + if (userPropertyHandler == null) continue; + boolean visible = UserManager.getInstance().isMandatoryUserProperty(USER_PROPS_ID , userPropertyHandler); + manageChecklistTable.addColumnDescriptor(visible, userPropertyHandler.getColumnDescriptor(i++, DETAILS_ACTION, getLocale())); + cols++; + } + + int j = 500; for( Checkpoint checkpoint : checklist.getCheckpoints() ) { String pointTitle = checkpoint.getTitle() == null ? "" : checkpoint.getTitle(); - manageChecklistTable.addColumnDescriptor(new ChecklistMultiSelectColumnDescriptor(pointTitle, i)); - i++; + manageChecklistTable.addColumnDescriptor(new ChecklistMultiSelectColumnDescriptor(pointTitle, j++)); + cols++; } - manageChecklistTable.addColumnDescriptor(new BooleanColumnDescriptor("cl.edit.title", i, EDIT_ACTION, translate(EDIT_ACTION), "")); + manageChecklistTable.addColumnDescriptor(new StaticColumnDescriptor(EDIT_ACTION, "cl.edit.title", translate(EDIT_ACTION))); + cols++; + manageChecklistTable.setMultiSelect(false); + manageTableData = new ChecklistManageTableDataModel(checklist, lstIdents, userPropertyHandlers, cols); manageChecklistTable.setTableDataModel(manageTableData); panel.setContent(manageChecklistTable.getInitialComponent()); @@ -352,7 +377,8 @@ public class ChecklistManageCheckpointsController extends BasicController { if(source == manageChecklistTable) { if(event.getCommand().equals(Table.COMMANDLINK_ROWACTION_CLICKED)) { TableEvent tableEvent = (TableEvent)event; - selectedIdentity = manageTableData.getParticipantAt(tableEvent.getRowId()); + Long identityKey = manageTableData.getParticipantKeyAt(tableEvent.getRowId()); + selectedIdentity = securityManager.loadIdentityByKey(identityKey, false); if(tableEvent.getActionId().equals(EDIT_ACTION)) { initEditTable(ureq, selectedIdentity); VelocityContainer vcManageUser = createVelocityContainer("manageUser"); diff --git a/src/main/java/de/bps/olat/modules/cl/ChecklistManageTableDataModel.java b/src/main/java/de/bps/olat/modules/cl/ChecklistManageTableDataModel.java index 2d7354f95d2..09b51054fb2 100644 --- a/src/main/java/de/bps/olat/modules/cl/ChecklistManageTableDataModel.java +++ b/src/main/java/de/bps/olat/modules/cl/ChecklistManageTableDataModel.java @@ -20,63 +20,102 @@ package de.bps.olat.modules.cl; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.Locale; import org.olat.core.gui.components.table.DefaultTableDataModel; import org.olat.core.id.Identity; -import org.olat.core.id.UserConstants; +import org.olat.user.propertyhandlers.UserPropertyHandler; -public class ChecklistManageTableDataModel extends DefaultTableDataModel { - - private static int COLUMN_COUNT; - private static int ROW_COUNT; +import de.bps.olat.modules.cl.ChecklistManageTableDataModel.Row; + +public class ChecklistManageTableDataModel extends DefaultTableDataModel<Row> { - private Checklist checklist; - private List<Identity> participants; - private List entries; + private int colCount; + private int rowCount; - @SuppressWarnings("unchecked") - public ChecklistManageTableDataModel(Checklist checklist, List<Identity> participants) { - super(participants); - this.checklist = checklist; - this.participants = participants; + public ChecklistManageTableDataModel(Checklist checklist, List<Identity> participants, + List<UserPropertyHandler> userPropertyHandlers, int cols) { + super(Collections.<Row>emptyList()); - COLUMN_COUNT = checklist.getCheckpoints().size() + 2; - ROW_COUNT = participants.size(); + colCount = cols; + rowCount = participants.size(); - this.entries = new ArrayList(ROW_COUNT); + List<Row> entries = new ArrayList<>(rowCount); for( Identity identity : participants ) { - List row = new ArrayList(COLUMN_COUNT); - // name - row.add( - identity.getUser().getProperty(UserConstants.FIRSTNAME, getLocale()) + " " + - identity.getUser().getProperty(UserConstants.LASTNAME, getLocale())); - // checkpoints value - for( Checkpoint checkpoint : this.checklist.getCheckpointsSorted(ChecklistUIFactory.comparatorTitleAsc) ) { - row.add(checkpoint.getSelectionFor(identity)); - } - // action - row.add(true); - // add to columns - entries.add(row); + entries.add(new Row(identity, userPropertyHandlers, checklist, Locale.ENGLISH)); } + setObjects(entries); } + @Override public int getColumnCount() { // name, 1-n checkpoints, action - return COLUMN_COUNT; + return colCount; } - public int getRowCount() { - return ROW_COUNT; + @Override + public Object getValueAt(int row, int col) { + Row rowObj = getObject(row); + if(col == 1000) { + return rowObj.getIdentityName(); + } else if(col < 500) { + String[] props = rowObj.getIdentityProps(); + if(col >= 0 && col < props.length) { + return props[col]; + } + } else { + Boolean[] props = rowObj.getCheckpoints(); + int index = col - 500; + if(index >= 0 && index < props.length) { + return props[index]; + } + } + return ""; } - public Object getValueAt(int row, int col) { - List entry = (List)entries.get(row); - return entry.get(col); + public Long getParticipantKeyAt(int row) { + Row rowObj = getObject(row); + return rowObj.getIdentityKey(); } - public Identity getParticipantAt(int row) { - return participants.get(row); + protected static class Row { + private final Long identityKey; + private final String identityName; + private final String[] identityProps; + private final Boolean[] checkpoints; + + public Row(Identity identity, List<UserPropertyHandler> userPropertyHandlers, Checklist checklist, Locale locale) { + this.identityKey = identity.getKey(); + this.identityName = identity.getName(); + + identityProps = new String[userPropertyHandlers.size()]; + for(int i=userPropertyHandlers.size(); i-->0; ) { + identityProps[i] = userPropertyHandlers.get(i).getUserProperty(identity.getUser(), locale); + } + + List<Checkpoint> checkpointList = checklist.getCheckpointsSorted(ChecklistUIFactory.comparatorTitleAsc); + checkpoints = new Boolean[checkpointList.size()]; + for( int i=checkpointList.size(); i-->0; ) { + checkpoints[i] = checkpointList.get(i).getSelectionFor(identity); + } + } + + public Long getIdentityKey() { + return identityKey; + } + + public String getIdentityName() { + return identityName; + } + + public String[] getIdentityProps() { + return identityProps; + } + + public Boolean[] getCheckpoints() { + return checkpoints; + } } } diff --git a/src/main/java/de/bps/olat/modules/cl/ChecklistRunTableDataModel.java b/src/main/java/de/bps/olat/modules/cl/ChecklistRunTableDataModel.java index 8d36d1d1f54..20ef33d5b88 100644 --- a/src/main/java/de/bps/olat/modules/cl/ChecklistRunTableDataModel.java +++ b/src/main/java/de/bps/olat/modules/cl/ChecklistRunTableDataModel.java @@ -32,7 +32,7 @@ import org.olat.core.gui.translator.Translator; * Initial Date: 11.08.2009 <br> * @author bja <bja@bps-system.de> */ -public class ChecklistRunTableDataModel extends DefaultTableDataModel { +public class ChecklistRunTableDataModel extends DefaultTableDataModel<Checkpoint> { private static final int COLUMN_COUNT = 3; private Translator translator; @@ -49,7 +49,7 @@ public class ChecklistRunTableDataModel extends DefaultTableDataModel { @Override public Object getValueAt(int row, int col) { - Checkpoint checkpoint = (Checkpoint) objects.get(row); + Checkpoint checkpoint = getObject(row); switch (col) { case 0: diff --git a/src/main/java/de/bps/olat/modules/cl/ChecklistUIFactory.java b/src/main/java/de/bps/olat/modules/cl/ChecklistUIFactory.java index f62330f4324..6c14a35a588 100644 --- a/src/main/java/de/bps/olat/modules/cl/ChecklistUIFactory.java +++ b/src/main/java/de/bps/olat/modules/cl/ChecklistUIFactory.java @@ -19,8 +19,6 @@ */ package de.bps.olat.modules.cl; -import java.util.List; - import org.olat.core.gui.UserRequest; import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.DefaultController; @@ -69,8 +67,8 @@ public class ChecklistUIFactory { * @param course * @return controller */ - public Controller createDisplayController(UserRequest ureq, WindowControl wControl, Checklist checklist, List<ChecklistFilter> filter, boolean canEdit, boolean canManage, ICourse course, CourseNode coursenode) { - DefaultController checklistController = new ChecklistDisplayController(ureq, wControl, checklist, filter, canEdit, canManage, course); + public Controller createDisplayController(UserRequest ureq, WindowControl wControl, Checklist checklist, boolean canEdit, boolean canManage, ICourse course, CourseNode coursenode) { + DefaultController checklistController = new ChecklistDisplayController(ureq, wControl, checklist, canEdit, canManage, course); checklistController.addLoggingResourceable(LoggingResourceable.wrap(coursenode)); return checklistController; } @@ -83,8 +81,8 @@ public class ChecklistUIFactory { * @param filter * @return controller */ - public Controller createDisplayController(UserRequest ureq, WindowControl wControl, Checklist checklist, List<ChecklistFilter> filter) { - return new ChecklistDisplayController(ureq, wControl, checklist, filter, false, false, null); + public Controller createDisplayController(UserRequest ureq, WindowControl wControl, Checklist checklist) { + return new ChecklistDisplayController(ureq, wControl, checklist, false, false, null); } /** diff --git a/src/main/java/org/olat/user/propertyhandlers/_spring/userPropertiesContext.xml b/src/main/java/org/olat/user/propertyhandlers/_spring/userPropertiesContext.xml index b1cabc8695f..5ad10984989 100644 --- a/src/main/java/org/olat/user/propertyhandlers/_spring/userPropertiesContext.xml +++ b/src/main/java/org/olat/user/propertyhandlers/_spring/userPropertiesContext.xml @@ -639,6 +639,37 @@ </bean> </entry> + <entry key="de.bps.olat.modules.cl.ChecklistManageCheckpointsController"> + <bean class="org.olat.user.propertyhandlers.UserPropertyUsageContext"> + <property name="description" value="List of users in the check list course building block" /> + <property name="propertyHandlers"> + <list> + <ref bean="userPropertyFirstName" /> + <ref bean="userPropertyLastName" /> + <ref bean="userPropertyInstitutionalUserIdentifier" /> + </list> + </property> + <property name="userViewReadOnlyProperties"> + <set> + <ref bean="userPropertyFirstName" /> + <ref bean="userPropertyLastName" /> + </set> + </property> + <property name="mandatoryProperties"> + <set> + <ref bean="userPropertyFirstName" /> + <ref bean="userPropertyLastName" /> + <ref bean="userPropertyInstitutionalUserIdentifier" /> + </set> + </property> + <property name="adminViewOnlyProperties"> + <set> + <ref bean="userPropertyInstitutionalUserIdentifier" /> + </set> + </property> + </bean> + </entry> + <entry key="org.olat.admin.user.UserShortDescription"> <bean class="org.olat.user.propertyhandlers.UserPropertyUsageContext"> <property name="description" value="Short description of a user" /> -- GitLab