package no.dusken.aranea.web.control;
import no.dusken.aranea.model.Page;
import no.dusken.aranea.model.Section;
import no.dusken.aranea.service.PageService;
import no.dusken.aranea.service.SectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;
/**
* @author Marvin B. Lillehaug <lillehau@underdusken.no>
*/
@Controller
public class MeningerController {
private SectionService sectionService;
private PageService pageService;
@RequestMapping("/mening.do")
public String getMening(Model model){
Section meninger = sectionService.getSectionByUrl("meninger", null);
List<Page> pages = pageService.getSectionPagePublished(1, meninger);
model.addAttribute("mening", pages);
return "no/dusken/aranea/base/web/page/mening";
}
@Autowired
public void setSectionService(SectionService sectionService) {
this.sectionService = sectionService;
}
@Autowired
public void setPageService(PageService pageService) {
this.pageService = pageService;
}
}