Package com.m4f.business.domain

Examples of com.m4f.business.domain.Course


  @Secured("ROLE_AUTOMATIC_MEDIATOR")
  @RequestMapping(value="/delete/{courseId}", method=RequestMethod.GET)
  public String delete(@PathVariable Long courseId, Locale locale,
      @RequestHeader("referer") String referer, @RequestHeader("Host") String host) {
    try {
      Course course = this.serviceLocator.getCourseService().getCourse(courseId, locale);
      this.serviceLocator.getCourseService().deleteLogic(course, locale);
    } catch(Exception e) {
      LOGGER.severe(StackTraceUtil.getStackTrace(e));
      return "common.error";
    }
View Full Code Here


 
  @Secured({"ROLE_AUTOMATIC_MEDIATOR","ROLE_ADMIN"})
  @RequestMapping(value="/detail/{courseId}", method=RequestMethod.GET)
  public String detail(@PathVariable Long courseId, Model model, Locale locale) {
    try {
      Course course = this.serviceLocator.getCourseService().getCourse(courseId, locale);
      School school = this.serviceLocator.getSchoolService().getSchool(course.getSchool(), locale);
      model.addAttribute("course", course);
      model.addAttribute("school", school);
    } catch(Exception e) {
      LOGGER.severe(StackTraceUtil.getStackTrace(e));
      return "common.error";
View Full Code Here

 
  private String redirectToCourseDetail(HttpServletResponse response,
    Long courseId, Model model, Locale locale) throws GenericException {
    try {
      HashMap<String, Object> courseData = this.getDataFromCache(courseId, locale);
      Course course = (Course) courseData.get("course");
     
      model.addAttribute("provider", courseData.get("provider"));
      model.addAttribute("school", courseData.get("school"));
      model.addAttribute("course", course);
      model.addAttribute("province", courseData.get("province"));
      model.addAttribute("region", courseData.get("region"));
      model.addAttribute("town", courseData.get("town"));
      model.addAttribute("tags", courseData.get("tags"));
     
      response.addDateHeader("Last-Modified", course.getStart() != null ? course.getStart().getTime() : course.getUpdated().getTime());
    } catch(Exception e) {
      throw new GenericException(e);
    }
    return "search.result.detail";
  }
View Full Code Here

    }
   
    courseData = courses.get(courseId);
    if(courseData == null) {
      courseData = new HashMap<String, Object>();
      Course course = this.serviceLocator.getCourseService().getCourse(courseId, locale);
      School school = this.serviceLocator.getSchoolService().getSchool(course.getSchool(), locale);
      Provider provider = this.serviceLocator.getProviderService().getProviderById(school.getProvider(), locale);
     
      String townName = school.getContactInfo() != null &&
          school.getContactInfo().getCity() != null ?
          school.getContactInfo().getCity() : "";
     

      //Town town = this.getTownByName(townName, locale);

      Town town = this.serviceLocator.getTerritorialService().getTownsMap(locale).get(townName);
     
      Province province = new Province();
      Region region = new Region();
     
      if(town != null && town.getId() != null) {
        region = this.serviceLocator.getTerritorialService().getRegionsMap(locale).get(town.getRegion());
        province = this.serviceLocator.getTerritorialService().getProvincesMap(locale).get(town.getProvince());
      } else {
        town = new Town();
      }
     
     
      // Metadata
      StringBuffer keyWords = new StringBuffer();
      for(Category tag : course.getTags()) {
        keyWords.append(tag.getCategory()).append(",");
      }
     
      // Create courseData
      courseData.put("provider", provider);
View Full Code Here

TOP

Related Classes of com.m4f.business.domain.Course

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.