Skip to content

Commit

Permalink
SAK-41723 Ensure correct order of top level pages (sakaiproject#6908)
Browse files Browse the repository at this point in the history
https://jira.sakaiproject.org/browse/SAK-41723

Top level page order should be the same as the order of the Lessons
tools in the tool menu
  • Loading branch information
adrianfish authored May 14, 2019
1 parent 16d7d0c commit 6fbe977
Show file tree
Hide file tree
Showing 3 changed files with 551 additions and 534 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.Optional;

import org.sakaiproject.lessonbuildertool.SimplePage;
import org.sakaiproject.lessonbuildertool.SimplePageComment;
Expand All @@ -44,6 +45,8 @@
import org.sakaiproject.lessonbuildertool.SimpleChecklistItem;
import org.sakaiproject.lessonbuildertool.ChecklistItemStatus;

import org.sakaiproject.site.api.ToolConfiguration;

import org.springframework.orm.hibernate4.HibernateTemplate;

public interface SimplePageToolDao {
Expand Down Expand Up @@ -332,4 +335,6 @@ public class PageData {
public String getLessonSubPageJSON(String userId, boolean isInstructor, String siteId, List pages);

public List<SimplePage> getTopLevelPages(String siteId);

public Optional<List<ToolConfiguration>> getSiteTools(String siteId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;

import lombok.Setter;
Expand Down Expand Up @@ -931,6 +932,16 @@ public SimplePage getPage(long pageId) {
}
}

public Optional<List<ToolConfiguration>> getSiteTools(String siteId) {

try {
return Optional.of(new ArrayList(siteService.getSite(siteId).getTools(LessonBuilderConstants.TOOL_COMMON_ID)));
} catch (IdUnusedException iue) {
log.warn("{} is not a valid site id", siteId);
}
return Optional.empty();
}

public String getPageUrl(long pageId) {

List<SimplePageItem> pageItems = findPageItemsBySakaiId(Long.toString(pageId));
Expand Down
Loading

0 comments on commit 6fbe977

Please sign in to comment.