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

Merge remote-tracking branch 'origin/OpenOLAT_14.2'

parents 76d4478a 829e88fb
No related branches found
No related tags found
No related merge requests found
......@@ -127,7 +127,8 @@ public class VideoNotificationsHandler implements NotificationsHandler {
.getURLFromBusinessPathString(businessPath);
List<SubscriptionListItem> items = new ArrayList<>();
List<UserComment> comments = commentAndRatingService.getComments(re.getOlatResource(), p.getSubidentifier());
String subIdentifier = StringHelper.containsNonWhitespace(p.getSubidentifier()) ? p.getSubidentifier() : null;
List<UserComment> comments = commentAndRatingService.getComments(re.getOlatResource(), subIdentifier);
for (UserComment comment : comments) {
if (compareDate.before(comment.getCreationDate())) {
String desc;
......
......@@ -86,7 +86,7 @@ public class VideoEntryDataSource implements FlexiTableDataSourceDelegate<Reposi
public ResultInfos<RepositoryEntryRow> getRows(String query, List<FlexiTableFilter> filters,
List<String> condQueries, int firstResult, int maxResults, SortKey... orderBy) {
if(condQueries != null && condQueries.size() > 0) {
if(condQueries != null && !condQueries.isEmpty()) {
String filter = condQueries.get(0);
if(StringHelper.containsNonWhitespace(filter)) {
searchParams.setFilters(Collections.singletonList(Filter.valueOf(filter)));
......@@ -111,7 +111,7 @@ public class VideoEntryDataSource implements FlexiTableDataSourceDelegate<Reposi
List<RepositoryEntryRow> rows = processViewModel(views);
ResultInfos<RepositoryEntryRow> results = new DefaultResultInfos<>(firstResult + rows.size(), -1, rows);
if(firstResult == 0 && views.size() < maxResults) {
count = new Integer(views.size());
count = Integer.valueOf(views.size());
}
return results;
}
......
......@@ -59,6 +59,7 @@ import org.olat.fileresource.types.VideoFileResource;
import org.olat.modules.video.ui.VideoEntryDataModel.Cols;
import org.olat.repository.RepositoryEntry;
import org.olat.repository.RepositoryEntrySecurity;
import org.olat.repository.RepositoryEntryStatusEnum;
import org.olat.repository.RepositoryManager;
import org.olat.repository.RepositoryModule;
import org.olat.repository.RepositoryService;
......@@ -81,7 +82,6 @@ public class VideoListingController extends FormBasicController implements Activ
private final String imgUrl;
private FlexiTableElement tableEl;
private VideoEntryDataModel model;
private VideoEntryDataSource dataSource;
private SearchMyRepositoryEntryViewParams searchParams;
......@@ -94,11 +94,12 @@ public class VideoListingController extends FormBasicController implements Activ
public VideoListingController(UserRequest ureq, WindowControl wControl, TooledStackedPanel toolbarPanel) {
super(ureq, wControl, "video_listing");
this.setTranslator(Util.createPackageTranslator(RepositoryService.class, getLocale(), getTranslator()));
setTranslator(Util.createPackageTranslator(RepositoryService.class, getLocale(), getTranslator()));
this.toolbarPanel = toolbarPanel;
searchParams = new SearchMyRepositoryEntryViewParams(getIdentity(), ureq.getUserSession().getRoles(), VideoFileResource.TYPE_NAME);
searchParams.setEntryStatus(new RepositoryEntryStatusEnum[] { RepositoryEntryStatusEnum.published });
dataSource = new VideoEntryDataSource(searchParams);
imgUrl = registerMapper(ureq, new VideoMapper());
......@@ -111,7 +112,7 @@ public class VideoListingController extends FormBasicController implements Activ
FlexiTableColumnModel columnsModel = FlexiTableDataModelFactory.createFlexiTableColumnModel();
columnsModel.addFlexiColumnModel(new DefaultFlexiColumnModel(false, Cols.key.i18nKey(), Cols.key.ordinal(), true, OrderBy.key.name()));
model = new VideoEntryDataModel(dataSource, columnsModel);
VideoEntryDataModel model = new VideoEntryDataModel(dataSource, columnsModel);
tableEl = uifactory.addTableElement(getWindowControl(), "table", model, 20, false, getTranslator(), formLayout);
tableEl.setAvailableRendererTypes(FlexiTableRendererType.custom);
tableEl.setRendererType(FlexiTableRendererType.custom);
......
......@@ -229,12 +229,8 @@ public class RepositoryEntryMyCourseQueries {
sb.append(" where ");
needIdentityKey |= appendMyViewAccessSubSelect(sb, roles, params.getFilters(), params.isMembershipMandatory());
if(params.getClosed() != null) {
if(params.getClosed().booleanValue()) {
sb.append(" and v.status ").in(RepositoryEntryStatusEnum.closed);
} else {
sb.append(" and v.status ").in(RepositoryEntryStatusEnum.preparationToPublished());
}
if(params.getEntryStatus() != null) {
sb.append(" and v.status ").in(params.getEntryStatus());
}
if(params.getFilters() != null) {
......
......@@ -26,6 +26,7 @@ import org.olat.core.id.Identity;
import org.olat.core.id.Roles;
import org.olat.modules.curriculum.CurriculumRef;
import org.olat.repository.CatalogEntry;
import org.olat.repository.RepositoryEntryStatusEnum;
/**
*
......@@ -38,8 +39,8 @@ public class SearchMyRepositoryEntryViewParams {
private Roles roles;
private Boolean marked;
private Boolean closed;
private boolean membershipMandatory = false;
private RepositoryEntryStatusEnum[] entryStatus;
private OrderBy orderBy;
private boolean asc;
......@@ -182,12 +183,12 @@ public class SearchMyRepositoryEntryViewParams {
return roles;
}
public Boolean getClosed() {
return closed;
public RepositoryEntryStatusEnum[] getEntryStatus() {
return entryStatus;
}
public void setClosed(Boolean closed) {
this.closed = closed;
public void setEntryStatus(RepositoryEntryStatusEnum[] entryStatus) {
this.entryStatus = entryStatus;
}
public Boolean getMarked() {
......
......@@ -47,6 +47,7 @@ import org.olat.core.util.resource.OresHelper;
import org.olat.core.util.vfs.VFSLeaf;
import org.olat.repository.CatalogEntry;
import org.olat.repository.CatalogEntry.Style;
import org.olat.repository.RepositoryEntryStatusEnum;
import org.olat.repository.RepositoryManager;
import org.olat.repository.manager.CatalogManager;
import org.olat.repository.model.SearchMyRepositoryEntryViewParams;
......@@ -144,7 +145,7 @@ public class CatalogNodeController extends BasicController implements Activateab
SearchMyRepositoryEntryViewParams searchParams
= new SearchMyRepositoryEntryViewParams(getIdentity(), ureq.getUserSession().getRoles());
searchParams.setParentEntry(catalogEntry);
searchParams.setClosed(Boolean.FALSE);
searchParams.setEntryStatus(RepositoryEntryStatusEnum.preparationToPublished());
entryListController = new RepositoryEntryListController(ureq, wControl, searchParams, true, false, "catalog", stackPanel);
if(!entryListController.isEmpty() || searchParams.getFilters() != null) {
......@@ -156,7 +157,7 @@ public class CatalogNodeController extends BasicController implements Activateab
SearchMyRepositoryEntryViewParams searchClosedParams
= new SearchMyRepositoryEntryViewParams(getIdentity(), ureq.getUserSession().getRoles());
searchClosedParams.setParentEntry(catalogEntry);
searchClosedParams.setClosed(Boolean.TRUE);
searchClosedParams.setEntryStatus(new RepositoryEntryStatusEnum[] {RepositoryEntryStatusEnum.closed });
closedEntryListController = new RepositoryEntryListController(ureq, wControl, searchClosedParams, true, false, "catalog-closed", stackPanel);
if(!closedEntryListController.isEmpty() || searchClosedParams.getFilters() != null) {
mainVC.put("closedEntries", closedEntryListController.getInitialComponent());
......
......@@ -49,6 +49,7 @@ import org.olat.modules.curriculum.CurriculumModule;
import org.olat.modules.curriculum.CurriculumService;
import org.olat.modules.curriculum.ui.CurriculumListController;
import org.olat.repository.CatalogEntry;
import org.olat.repository.RepositoryEntryStatusEnum;
import org.olat.repository.RepositoryManager;
import org.olat.repository.RepositoryModule;
import org.olat.repository.RepositoryService;
......@@ -314,7 +315,7 @@ public class OverviewRepositoryListController extends BasicController implements
SearchMyRepositoryEntryViewParams searchParams
= new SearchMyRepositoryEntryViewParams(getIdentity(), ureq.getUserSession().getRoles());
searchParams.setMembershipMandatory(true);
searchParams.setClosed(Boolean.FALSE);
searchParams.setEntryStatus(RepositoryEntryStatusEnum.preparationToPublished());
OLATResourceable ores = OresHelper.createOLATResourceableInstance("My", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
......@@ -407,7 +408,7 @@ public class OverviewRepositoryListController extends BasicController implements
SearchMyRepositoryEntryViewParams searchParams
= new SearchMyRepositoryEntryViewParams(getIdentity(), ureq.getUserSession().getRoles());
searchParams.setMembershipMandatory(true);
searchParams.setClosed(Boolean.TRUE);
searchParams.setEntryStatus(new RepositoryEntryStatusEnum[] {RepositoryEntryStatusEnum.closed });
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Closed", 0l);
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
......
......@@ -80,6 +80,7 @@ import org.olat.core.util.Util;
import org.olat.core.util.resource.OresHelper;
import org.olat.course.CorruptedCourseException;
import org.olat.repository.RepositoryEntry;
import org.olat.repository.RepositoryEntryStatusEnum;
import org.olat.repository.RepositoryManager;
import org.olat.repository.RepositoryModule;
import org.olat.repository.RepositoryService;
......@@ -511,7 +512,15 @@ public class RepositoryEntryListController extends FormBasicController
searchParams.setAuthor(se.getAuthor());
searchParams.setText(se.getDisplayname());
searchParams.setMembershipMandatory(se.isMembershipMandatory());
searchParams.setClosed(se.getClosed());
if(se.getClosed() != null) {
if(se.getClosed().booleanValue()) {
searchParams.setEntryStatus(new RepositoryEntryStatusEnum[] { RepositoryEntryStatusEnum.closed });
} else {
searchParams.setEntryStatus(RepositoryEntryStatusEnum.preparationToPublished());
}
} else {
searchParams.setEntryStatus(null);
}
tableEl.reset(true, true, true);
RepositoryEntryListState state = new RepositoryEntryListState();
......
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