use of ai.elimu.model.Contributor in project webapp by elimu-ai.
the class VideoListController method handleRequest.
@RequestMapping(method = RequestMethod.GET)
public String handleRequest(Model model, HttpSession session) {
logger.info("handleRequest");
Contributor contributor = (Contributor) session.getAttribute("contributor");
List<Video> videos = videoDao.readAllOrdered(contributor.getLocale());
model.addAttribute("videos", videos);
return "content/multimedia/video/list";
}
use of ai.elimu.model.Contributor in project webapp by elimu-ai.
the class NumberCreateController method handleRequest.
@RequestMapping(method = RequestMethod.GET)
public String handleRequest(HttpSession session, Model model) {
logger.info("handleRequest");
Number number = new Number();
model.addAttribute("number", number);
Contributor contributor = (Contributor) session.getAttribute("contributor");
List<Word> words = wordDao.readAllOrdered(contributor.getLocale());
model.addAttribute("words", words);
return "content/number/create";
}
use of ai.elimu.model.Contributor in project webapp by elimu-ai.
the class NumberEditController method handleRequest.
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public String handleRequest(HttpSession session, Model model, @PathVariable Long id) {
logger.info("handleRequest");
Number number = numberDao.read(id);
model.addAttribute("number", number);
Contributor contributor = (Contributor) session.getAttribute("contributor");
List<Word> words = wordDao.readAllOrdered(contributor.getLocale());
model.addAttribute("words", words);
return "content/number/edit";
}
use of ai.elimu.model.Contributor in project webapp by elimu-ai.
the class StoryBookEditController method handleRequest.
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public String handleRequest(Model model, @PathVariable Long id, HttpSession session) {
logger.info("handleRequest");
Contributor contributor = (Contributor) session.getAttribute("contributor");
StoryBook storyBook = storyBookDao.read(id);
model.addAttribute("storyBook", storyBook);
model.addAttribute("contentLicenses", ContentLicense.values());
List<Image> coverImages = imageDao.readAllOrdered(contributor.getLocale());
model.addAttribute("coverImages", coverImages);
model.addAttribute("gradeLevels", GradeLevel.values());
Map<String, Integer> wordFrequencyMap = WordFrequencyHelper.getWordFrequency(storyBook);
model.addAttribute("wordFrequencyMap", wordFrequencyMap);
Map<String, Integer> letterFrequencyMap = LetterFrequencyHelper.getLetterFrequency(storyBook);
model.addAttribute("letterFrequencyMap", letterFrequencyMap);
return "content/storybook/edit";
}
use of ai.elimu.model.Contributor in project webapp by elimu-ai.
the class StoryBookListController method handleRequest.
@RequestMapping(method = RequestMethod.GET)
public String handleRequest(Model model, HttpSession session) {
logger.info("handleRequest");
Contributor contributor = (Contributor) session.getAttribute("contributor");
// To ease development/testing, auto-generate StoryBooks
List<StoryBook> storyBooksGenerated = generateStoryBooks(contributor.getLocale());
for (StoryBook storyBook : storyBooksGenerated) {
StoryBook existingStoryBook = storyBookDao.readByTitle(storyBook.getLocale(), storyBook.getTitle());
if (existingStoryBook == null) {
storyBookDao.create(storyBook);
}
}
List<StoryBook> storyBooks = storyBookDao.readAllOrdered(contributor.getLocale());
model.addAttribute("storyBooks", storyBooks);
return "content/storybook/list";
}
Aggregations