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

OO-3292: minimal curriculum viewer with permission restrictions

parent 287d8e58
No related branches found
No related tags found
No related merge requests found
Showing
with 573 additions and 3 deletions
/**
* <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.modules.curriculum;
import org.olat.core.id.CreateInfo;
......
/**
* <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.modules.curriculum;
/**
......
......@@ -81,6 +81,7 @@ public interface CurriculumService {
public CurriculumElement createCurriculumElement(String identifier, String displayName, Date beginDate, Date endDate,
CurriculumElementRef parent, CurriculumElementType elementType, Curriculum curriculum);
public CurriculumElement getCurriculumElement(CurriculumElementRef element);
/**
......@@ -89,7 +90,7 @@ public interface CurriculumService {
* @param curriculum The curriculum
* @return A list of curriculum elements
*/
public List<CurriculumElement> getCurriculumElements(CurriculumRef element);
public List<CurriculumElement> getCurriculumElements(CurriculumRef curriculum);
/**
* Return the parent line of the specified curriculum element.
......
/**
* <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.modules.curriculum.manager;
import java.util.Date;
......
/**
* <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.modules.curriculum.model;
import org.olat.basesecurity.GroupMembershipInheritance;
......
/**
* <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.modules.curriculum.model;
import org.olat.modules.curriculum.CurriculumElementTypeRef;
......
/**
* <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.modules.curriculum.model;
import java.util.Date;
......
/**
* <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.modules.curriculum.ui;
import org.olat.core.commons.persistence.SortKey;
import org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiTableDataModel;
import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiSortableColumnDef;
import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel;
import org.olat.core.gui.components.form.flexible.impl.elements.table.SortableFlexiTableDataModel;
/**
*
* Initial date: 11 mai 2018<br>
* @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
*
*/
public class CurriculumElementDataModel extends DefaultFlexiTableDataModel<CurriculumElementRow>
implements SortableFlexiTableDataModel<CurriculumElementRow> {
public CurriculumElementDataModel(FlexiTableColumnModel columnsModel) {
super(columnsModel);
}
@Override
public void sort(SortKey sortKey) {
//
}
@Override
public Object getValueAt(int row, int col) {
CurriculumElementRow curriculum = getObject(row);
return getValueAt(curriculum, col);
}
@Override
public Object getValueAt(CurriculumElementRow row, int col) {
switch(ElementCols.values()[col]) {
case key: return row.getKey();
case displayName: return row.getDisplayName();
case identifier: return row.getIdentifier();
default: return "ERROR";
}
}
@Override
public CurriculumElementDataModel createCopyWithEmptyList() {
return new CurriculumElementDataModel(getTableColumnModel());
}
public enum ElementCols implements FlexiSortableColumnDef {
key("table.header.key"),
displayName("table.header.displayName"),
identifier("table.header.identifier");
private final String i18nHeaderKey;
private ElementCols(String i18nHeaderKey) {
this.i18nHeaderKey = i18nHeaderKey;
}
@Override
public boolean sortable() {
return true;
}
@Override
public String sortKey() {
return name();
}
@Override
public String i18nHeaderKey() {
return i18nHeaderKey;
}
}
}
/**
* <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.modules.curriculum.ui;
import java.util.List;
import java.util.stream.Collectors;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.form.flexible.FormItemContainer;
import org.olat.core.gui.components.form.flexible.elements.FlexiTableElement;
import org.olat.core.gui.components.form.flexible.impl.FormBasicController;
import org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel;
import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel;
import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableDataModelFactory;
import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.WindowControl;
import org.olat.modules.curriculum.CurriculumElement;
import org.olat.modules.curriculum.CurriculumRef;
import org.olat.modules.curriculum.CurriculumService;
import org.olat.modules.curriculum.ui.CurriculumElementDataModel.ElementCols;
import org.springframework.beans.factory.annotation.Autowired;
/**
*
* Initial date: 11 mai 2018<br>
* @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
*
*/
public class CurriculumElementListController extends FormBasicController {
private FlexiTableElement tableEl;
private CurriculumElementDataModel tableModel;
private final CurriculumRef curriculum;
@Autowired
private CurriculumService curriculumService;
public CurriculumElementListController(UserRequest ureq, WindowControl wControl, CurriculumRef curriculum) {
super(ureq, wControl, "curriculum_element_list");
this.curriculum = curriculum;
initForm(ureq);
loadModel();
}
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, ElementCols.key));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ElementCols.displayName, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(ElementCols.identifier, "select"));
tableModel = new CurriculumElementDataModel(columnsModel);
tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, 20, false, getTranslator(), formLayout);
tableEl.setCustomizeColumns(true);
tableEl.setEmtpyTableMessageKey("table.curriculum.empty");
tableEl.setAndLoadPersistedPreferences(ureq, "cur-curriculum-manage");
}
private void loadModel() {
List<CurriculumElement> elements = curriculumService.getCurriculumElements(curriculum);
List<CurriculumElementRow> rows = elements.stream()
.map(element -> new CurriculumElementRow(element, null))
.collect(Collectors.toList());
tableModel.setObjects(rows);
tableEl.reset(true, true, true);
}
@Override
protected void doDispose() {
//
}
@Override
protected void formOK(UserRequest ureq) {
//
}
}
/**
* <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.modules.curriculum.ui;
import java.util.List;
......
/**
* <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.modules.curriculum.ui;
import java.util.List;
import java.util.stream.Collectors;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.form.flexible.FormItem;
import org.olat.core.gui.components.form.flexible.FormItemContainer;
import org.olat.core.gui.components.form.flexible.elements.FlexiTableElement;
import org.olat.core.gui.components.form.flexible.impl.FormBasicController;
import org.olat.core.gui.components.form.flexible.impl.FormEvent;
import org.olat.core.gui.components.form.flexible.impl.elements.table.DefaultFlexiColumnModel;
import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableColumnModel;
import org.olat.core.gui.components.form.flexible.impl.elements.table.FlexiTableDataModelFactory;
import org.olat.core.gui.components.form.flexible.impl.elements.table.SelectionEvent;
import org.olat.core.gui.components.stack.BreadcrumbedStackedPanel;
import org.olat.core.gui.control.Controller;
import org.olat.core.gui.control.WindowControl;
import org.olat.core.gui.control.generic.dtabs.Activateable2;
import org.olat.core.id.context.ContextEntry;
import org.olat.core.id.context.StateEntry;
import org.olat.modules.curriculum.Curriculum;
import org.olat.modules.curriculum.CurriculumService;
import org.olat.modules.curriculum.model.CurriculumSearchParameters;
import org.olat.modules.curriculum.ui.CurriculumManagerDataModel.CurriculumCols;
import org.springframework.beans.factory.annotation.Autowired;
/**
*
* Initial date: 11 mai 2018<br>
* @author srosse, stephane.rosse@frentix.com, http://www.frentix.com
*
*/
public class CurriculumListController extends FormBasicController implements Activateable2 {
private FlexiTableElement tableEl;
private CurriculumManagerDataModel tableModel;
private final BreadcrumbedStackedPanel stackPanel;
private CurriculumElementListController elementlistCtrl;
@Autowired
private CurriculumService curriculumService;
public CurriculumListController(UserRequest ureq, WindowControl wControl, BreadcrumbedStackedPanel stackPanel) {
super(ureq, wControl, "curriculum_list");
this.stackPanel = stackPanel;
initForm(ureq);
loadModel();
}
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, CurriculumCols.key));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(CurriculumCols.displayName, "select"));
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(CurriculumCols.identifier, "select"));
DefaultFlexiColumnModel toolsCol = new DefaultFlexiColumnModel(CurriculumCols.tools);
toolsCol.setExportable(false);
toolsCol.setAlwaysVisible(true);
columnsModel.addFlexiColumnModel(toolsCol);
tableModel = new CurriculumManagerDataModel(columnsModel);
tableEl = uifactory.addTableElement(getWindowControl(), "table", tableModel, 20, false, getTranslator(), formLayout);
tableEl.setCustomizeColumns(true);
tableEl.setEmtpyTableMessageKey("table.curriculum.empty");
tableEl.setAndLoadPersistedPreferences(ureq, "cur-curriculum-list");
}
private void loadModel() {
CurriculumSearchParameters params = new CurriculumSearchParameters();
List<Curriculum> curriculums = curriculumService.getCurriculums(params);
List<CurriculumRow> rows = curriculums.stream()
.map(curriculum -> new CurriculumRow(curriculum, null)).collect(Collectors.toList());
tableModel.setObjects(rows);
tableEl.reset(false, false, true);
}
@Override
protected void doDispose() {
//
}
@Override
public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) {
//
}
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if(tableEl == source) {
if(event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent)event;
String cmd = se.getCommand();
if("select".equals(cmd)) {
CurriculumRow row = tableModel.getObject(se.getIndex());
doSelectCurriculum(ureq, row);
}
}
}
super.formInnerEvent(ureq, source, event);
}
@Override
protected void formOK(UserRequest ureq) {
//
}
private void doSelectCurriculum(UserRequest ureq, CurriculumRow row) {
elementlistCtrl = new CurriculumElementListController(ureq, getWindowControl(), row);
listenTo(elementlistCtrl);
stackPanel.pushController(row.getDisplayName(), elementlistCtrl);
}
}
$r.render("table")
\ No newline at end of file
$r.render("table")
\ No newline at end of file
/**
* <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.modules.curriculum.ui.event;
import org.olat.core.gui.control.Event;
......
......@@ -473,6 +473,7 @@ search.course=Kurse
search.courses.closed=Beendet
search.courses.student=Suchen
search.cp=CP-Lerninhalte
search.curriculums=Curriculum
search.deleted=Gel\u00F6scht
search.filter.showAll=alle anzeigen
search.filter.type=Typ
......
......@@ -470,6 +470,7 @@ search.course=Courses
search.courses.closed=Finished
search.courses.student=Search
search.cp=CP learning content
search.curriculums=Curriculum
search.deleted=Deleted
search.filter.showAll=Show all
search.filter.type=Type
......
/**
* <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.repository.ui;
import java.util.Collections;
......
......@@ -45,6 +45,8 @@ import org.olat.core.util.Util;
import org.olat.core.util.event.EventBus;
import org.olat.core.util.event.GenericEventListener;
import org.olat.core.util.resource.OresHelper;
import org.olat.modules.curriculum.CurriculumModule;
import org.olat.modules.curriculum.ui.CurriculumListController;
import org.olat.repository.CatalogEntry;
import org.olat.repository.RepositoryManager;
import org.olat.repository.RepositoryModule;
......@@ -68,7 +70,11 @@ public class OverviewRepositoryListController extends BasicController implements
private final VelocityContainer mainVC;
private final SegmentViewComponent segmentView;
private final Link myCourseLink;
private Link favoriteLink, catalogLink, searchCourseLink, closedCourseLink;
private Link favoriteLink;
private Link catalogLink;
private Link searchCourseLink;
private Link closedCourseLink;
private Link curriculumLink;
private Controller currentCtrl;
private RepositoryEntryListController markedCtrl;
......@@ -77,6 +83,8 @@ public class OverviewRepositoryListController extends BasicController implements
private BreadcrumbedStackedPanel myCoursesStackPanel;
private CatalogNodeController catalogCtrl;
private BreadcrumbedStackedPanel catalogStackPanel;
private CurriculumListController curriculumListCtrl;
private BreadcrumbedStackedPanel curriculumStackPanel;
private RepositoryEntryListController searchCoursesCtrl;
private RepositoryEntryListController closedCoursesCtrl;
private BreadcrumbedStackedPanel searchCoursesStackPanel;
......@@ -90,6 +98,8 @@ public class OverviewRepositoryListController extends BasicController implements
private CatalogManager catalogManager;
@Autowired
private RepositoryModule repositoryModule;
@Autowired
private CurriculumModule curriculumModule;
public OverviewRepositoryListController(UserRequest ureq, WindowControl wControl) {
super(ureq, wControl);
......@@ -117,6 +127,12 @@ public class OverviewRepositoryListController extends BasicController implements
closedCourseLink.setElementCssClass("o_sel_mycourses_closed");
segmentView.addSegment(closedCourseLink, false);
if(curriculumModule.isEnabled() && curriculumModule.isCurriculumInMyCourses()) {
curriculumLink = LinkFactory.createLink("search.curriculums", mainVC, this);
curriculumLink.setElementCssClass("o_sel_mycurriculums");
segmentView.addSegment(curriculumLink, false);
}
if(repositoryModule.isCatalogEnabled() && repositoryModule.isCatalogBrowsingEnabled()) {
catalogLink = LinkFactory.createLink("search.catalog", mainVC, this);
catalogLink.setElementCssClass("o_sel_mycourses_catlog");
......@@ -181,6 +197,12 @@ public class OverviewRepositoryListController extends BasicController implements
ctrl.activate(ureq, entries, entry.getTransientState());
segmentView.select(catalogLink);
}
} else if("Curriculum".equalsIgnoreCase(segment)) {
CurriculumListController ctrl = doOpenCurriculum(ureq);
if(ctrl != null) {
ctrl.activate(ureq, subEntries, entry.getTransientState());
segmentView.select(curriculumLink);
}
} else if("Search".equalsIgnoreCase(segment) && searchCourseLink != null) {
doOpenSearchCourses(ureq).activate(ureq, subEntries, entry.getTransientState());
segmentView.select(searchCourseLink);
......@@ -231,6 +253,8 @@ public class OverviewRepositoryListController extends BasicController implements
doOpenMyCourses(ureq);
} else if (clickedLink == catalogLink) {
doOpenCatalog(ureq);
} else if (clickedLink == curriculumLink) {
doOpenCurriculum(ureq);
} else if(clickedLink == searchCourseLink) {
doOpenSearchCourses(ureq);
} else if(clickedLink == closedCourseLink) {
......@@ -304,7 +328,7 @@ public class OverviewRepositoryListController extends BasicController implements
List<CatalogEntry> entries = catalogManager.getRootCatalogEntries();
CatalogEntry rootEntry = null;
if(entries.size() > 0) {
if(!entries.isEmpty()) {
rootEntry = entries.get(0);
}
......@@ -322,6 +346,28 @@ public class OverviewRepositoryListController extends BasicController implements
return catalogCtrl;
}
private CurriculumListController doOpenCurriculum(UserRequest ureq) {
if(!curriculumModule.isEnabled() || !curriculumModule.isCurriculumInMyCourses()) {
return null;
}
cleanUp();
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Curriculum", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
curriculumStackPanel = new BreadcrumbedStackedPanel("curriculumstack", getTranslator(), this);
curriculumListCtrl = new CurriculumListController(ureq, bwControl, curriculumStackPanel);
curriculumStackPanel.pushController(translate("search.curriculums"), curriculumListCtrl);
listenTo(curriculumListCtrl);
currentCtrl = curriculumListCtrl;
addToHistory(ureq, curriculumListCtrl);
mainVC.put("segmentCmp", curriculumStackPanel);
return curriculumListCtrl;
}
private RepositoryEntryListController doOpenSearchCourses(UserRequest ureq) {
cleanUp();
......
/**
* <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.modules.curriculum.manager;
import java.util.List;
......
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