Package com.m4f.business.domain

Examples of com.m4f.business.domain.Provider


  public String getCourses(Principal currentUser, Model model, Locale locale,
      @RequestParam(defaultValue="1", required=false) Integer page,
      @RequestParam(defaultValue="", required=false) String order) {
    try {
      String ordering = order != null && !("").equals(order) ? order : "title";
      Provider provider =
        this.serviceLocator.getTransversalService().getProviderByUserName(currentUser.getName(), locale);
      model.addAttribute("provider", provider);
      PageManager<Course> paginator = new PageManager<Course>();
      paginator.setOffset(this.getPageSize());
      paginator.setUrlBase("/" + locale.getLanguage() +
          "/dashboard/mediator/catalog/courses");
      paginator.setStart((page-1)*paginator.getOffset());
      paginator.setSize(this.serviceLocator.getCourseService().countCoursesByProvider(provider.getId()));
      paginator.setCollection(this.serviceLocator.getCourseService().getCoursesByProvider(provider.getId(),
          ordering, locale, paginator.getStart(), paginator.getEnd()));
      model.addAttribute("paginator", paginator);
      model.addAttribute("order", ordering);
    } catch(Exception e) {
      LOGGER.severe(StackTraceUtil.getStackTrace(e));
View Full Code Here


  @RequestMapping(method=RequestMethod.GET)
  public String getForm(Principal currentUser, Model model, Locale locale,
      @RequestHeader(required=false,value="referer") String referer,
      HttpSession session) {
    try {
      Provider provider = this.getProvider(currentUser, locale);
      Course course = this.serviceLocator.getCourseService().createCourse();
      course.setProvider(provider.getId());
      model.addAttribute("course", course);
      session.setAttribute(this.REFERER_PARAM, referer);
    } catch(Exception e) {
      return this.viewHelper.errorManagement(e);
    }
View Full Code Here

  @Secured("ROLE_AUTOMATIC_MEDIATOR")
  @RequestMapping(value="/ajax/schools", method=RequestMethod.GET)
  public @ResponseBody List<School> getSchools(Principal currentUser,
      @RequestParam(required=true, defaultValue="") String letter, Locale locale) {
    try {
      Provider provider = this.getProvider(currentUser, locale);
      return this.serviceLocator.getSchoolService().getSchoolsByProvider(provider.getId(), letter, "name", locale);
    } catch (Exception e) {
      LOGGER.severe(StackTraceUtil.getStackTrace(e));
      return new ArrayList<School>();
    }
  }
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() : "";
     
View Full Code Here

TOP

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

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.