@RequestMapping(value = "/deleteLesson/{id}") public String deleteLesson(@PathVariable int id, Model model) { js.deleteLesson(id); model.addAttribute("entries", js.getJournalEntryList()); return "journal/listJournal"; }
@RequestMapping(value = "/addSdb") public String addSdb(Model model) { SDB sdb = js.addSdb(); return "redirect:/editSdb/" + sdb.getId(); }
@RequestMapping(value = "/updateTheWork", method = RequestMethod.POST) public String updateTheWork(@ModelAttribute TheWork theWork) { js.updateTheWork(theWork); return "redirect:/listJournal"; }
@RequestMapping(value = "/addTheWork") public String addTheWork(Model model) { TheWork theWork = js.addTheWork(); return "redirect:/editTheWork/" + theWork.getId(); }
@RequestMapping(value = "/updateLesson", method = RequestMethod.POST) public String updateLesson(@ModelAttribute Lesson lesson) { js.updateLesson(lesson); return "redirect:/listJournal"; }
@RequestMapping(value = "/updateGratitude", method = RequestMethod.POST) public String updateGratitude(@ModelAttribute Gratitude gratitude) { js.updateGratitude(gratitude); return "redirect:/listJournal"; }
@RequestMapping(value = "/updateSdb", method = RequestMethod.POST) public String updateSDB(@ModelAttribute SDB sdb) { js.updateSdb(sdb); return "redirect:/listJournal"; }
/** * Instantiates a new razor server, its services, and starts the scheduler. This can be replaced * by a dynamic handler manager but has the benefit of simplicity. */ public RazorServer() { super(); SERVICES.put(Service.ACCOUNT, AccountService.getInstance()); SERVICES.put(Service.ALERT, AlertService.getInstance()); SERVICES.put(Service.ASSET, AssetService.getInstance()); SERVICES.put(Service.ATTRIBUTE, AttributeService.getInstance()); SERVICES.put(Service.AUDIT, AuditService.getInstance()); SERVICES.put(Service.CONTRACT, ContractService.getInstance()); SERVICES.put(Service.FINANCE, FinanceService.getInstance()); SERVICES.put(Service.JOURNAL, JournalService.getInstance()); SERVICES.put(Service.IMAGE, ImageService.getInstance()); SERVICES.put(Service.IMAGETEXT, ImageTextService.getInstance()); SERVICES.put(Service.LICENSE, LicenseService.getInstance()); SERVICES.put(Service.LOCATION, LocationService.getInstance()); SERVICES.put(Service.MAIL, MailService.getInstance()); SERVICES.put(Service.MONITOR, MonitorService.getInstance()); SERVICES.put(Service.PARTNER, PartnerService.getInstance()); SERVICES.put(Service.PARTY, PartyService.getInstance()); SERVICES.put(Service.PRICE, PriceService.getInstance()); SERVICES.put(Service.PRODUCT, ProductService.getInstance()); SERVICES.put(Service.RATE, RateService.getInstance()); SERVICES.put(Service.REPORT, ReportService.getInstance()); SERVICES.put(Service.RESERVATION, ReservationService.getInstance()); SERVICES.put(Service.SESSION, SessionService.getInstance()); SERVICES.put(Service.SMS, SmsService.getInstance()); SERVICES.put(Service.TASK, TaskService.getInstance()); SERVICES.put(Service.TAX, TaxService.getInstance()); SERVICES.put(Service.TEXT, TextService.getInstance()); SERVICES.put(Service.WORKFLOW, WorkflowService.getInstance()); // startScheduler(); // PartnerService.startSchedulers(); }
@RequestMapping(value = "/addLesson") public String addLesson(Model model) { System.out.println("lesson added"); Lesson lesson = js.addLesson(); return "redirect:/editLesson/" + lesson.getId(); }
@RequestMapping(value = "/editTheWork/{id}") public String editTheWork(@PathVariable int id, Model model) { TheWork theWork = (TheWork) js.getTheWork(id); model.addAttribute("theWork", theWork); return "/journal/editTheWork"; }
@RequestMapping(value = "/editGratitude/{id}") public String editGratitude(@PathVariable int id, Model model) { Gratitude gratitude = (Gratitude) js.getGratitude(id); model.addAttribute("gratitude", gratitude); return "/journal/editGratitude"; }
@RequestMapping(value = "/editSdb/{id}") public String editSdb(@PathVariable int id, Model model) { SDB sdb = (SDB) js.getSdb(id); model.addAttribute("sdb", sdb); return "/journal/editSdb"; }
@RequestMapping(value = "/editLesson/{id}") public String editLesson(@PathVariable int id, Model model) { System.out.println("lesson edit called"); Lesson lesson = (Lesson) js.getLesson(id); model.addAttribute("lesson", lesson); return "/journal/editLesson"; }
@RequestMapping(value = "/listJournal") public String listTasks(Model model) { model.addAttribute("entries", js.getJournalEntryList()); return "/journal/listJournal"; }
@RequestMapping(value = "/addGratitude") public String addGratitude(Model model) { Gratitude gratitude = js.addGratitude(); return "redirect:/editGratitude/" + gratitude.getId(); }