Package com.m4f.business.domain

Examples of com.m4f.business.domain.Provider


 
  @RequestMapping(value="/detail/{providerId}", method=RequestMethod.GET)
  public String getDetail(@PathVariable Long providerId,
      Model model, Locale locale) {
    try {
      Provider provider = this.serviceLocator.getProviderService().getProviderById(providerId, locale);
      model.addAttribute("provider", provider);
    } catch (Exception e) {
      LOGGER.severe(StackTraceUtil.getStackTrace(e));
      return "common.error";
    }
View Full Code Here


 
  @RequestMapping(value="/{providerId}/schools", method=RequestMethod.GET)
  public String getSchools(@PathVariable Long providerId, Model model, Locale locale,
      @RequestParam(defaultValue="1", required=false) Integer page) {
    try {
      Provider provider = this.serviceLocator.getProviderService().getProviderById(providerId, locale);
      if(provider == null) {
        String message = "Provider with id " + providerId + " doesn't exist.";
        model.addAttribute("message", message);
        return "common.error";
      }
      model.addAttribute("provider", provider);
      PageManager<School> paginator = new PageManager<School>();
      paginator.setUrlBase("/" + locale.getLanguage() + "/provider/" + provider.getId() + "/schools");
      paginator.setStart((page-1)*paginator.getOffset());
      paginator.setSize(this.serviceLocator.getSchoolService().countSchoolsByProvider(provider.getId()));
      paginator.setCollection(this.serviceLocator.getSchoolService().getSchoolsByProvider(provider.getId(), "name", locale,
          paginator.getStart(), paginator.getEnd()));
      model.addAttribute("paginator", paginator);
    } catch(Exception e) {
      LOGGER.severe(StackTraceUtil.getStackTrace(e));
      return "common.error";
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

 
  @RequestMapping(value="/{providerId}/courses", method=RequestMethod.GET)
  public String getCourses(@PathVariable Long providerId, Model model, Locale locale,
      @RequestParam(defaultValue="1", required=false) Integer page) {
    try {
      Provider provider = this.serviceLocator.getProviderService().getProviderById(providerId, locale);
      if(provider == null) {
        String message = "Provider with id " + providerId + " doesn't exist.";
        model.addAttribute("message", message);
        return "common.error";
      }
      model.addAttribute("provider", provider);
      PageManager<Course> paginator = new PageManager<Course>();
      paginator.setUrlBase("/" + locale.getLanguage() + "/provider/" + provider.getId() + "/courses");
      paginator.setStart((page-1)*paginator.getOffset());
      paginator.setSize(this.serviceLocator.getCourseService().countCoursesByProvider(provider.getId()));
      paginator.setCollection(this.serviceLocator.getCourseService().getCoursesByProvider(providerId,
          null, locale, paginator.getStart(), paginator.getEnd()));
      model.addAttribute("paginator", paginator);
    } catch(Exception e) {
      LOGGER.severe(StackTraceUtil.getStackTrace(e));
View Full Code Here

 
  @RequestMapping(value="/{providerId}/dumps", method=RequestMethod.GET)
  public String getDumps(@PathVariable Long providerId, Model model, Locale locale,
      @RequestParam(defaultValue="1", required=false) Integer page) {
    try {
      Provider provider = this.serviceLocator.getProviderService().getProviderById(providerId, locale);
      if(provider == null) {
        String message = "Provider with id " +
          providerId + " doesn't exist.";
        model.addAttribute("message", message);
        return "common.error";
      }
      model.addAttribute("provider", provider);
      PageManager<Dump> paginator = new PageManager<Dump>();
      paginator.setUrlBase("/" + locale.getLanguage() +
          "/provider/" + provider.getId() + "/dumps");
      paginator.setStart((page-1)*paginator.getOffset());
      paginator.setSize(this.serviceLocator.getDumpService().countDumpsByOwner(providerId));
      paginator.setCollection(this.serviceLocator.getDumpService().getDumpsByOwner(providerId,
          paginator.getStart(), paginator.getEnd(), null));
      model.addAttribute("paginator", paginator);
View Full Code Here

  }
 
  @RequestMapping(value="/{providerId}/summary", method=RequestMethod.GET)
  public String getDumps(@PathVariable Long providerId, Model model, Locale locale) {
    try {
      Provider provider = this.serviceLocator.getProviderService().getProviderById(providerId, locale);
      Dump dump = this.serviceLocator.getDumpService().getLastDumpByOwner(provider.getId());
      if(dump != null) {
        model.addAttribute("dumpId", dump.getId());
      }
      model.addAttribute("providerId", provider.getId());
    } catch(Exception e) {
      LOGGER.severe(StackTraceUtil.getStackTrace(e));
      return "common.error";
    }
    return "summary.admin.today";
View Full Code Here

 
  @RequestMapping(value="/ajax/{providerId}", method=RequestMethod.GET)
  @ResponseBody
  public Provider getProvider(@PathVariable Long providerId,
      Locale locale) {
    Provider provider = null;
    try {
      provider = this.serviceLocator.getProviderService().getProviderById(providerId, locale);
      return provider;
    } catch (Exception e) {
      LOGGER.severe(StackTraceUtil.getStackTrace(e));
View Full Code Here

  @Override
  public void buildSeoEntity(Course course, Locale locale)
    throws ServiceNotFoundException, ContextNotActiveException, Exception {
   
    School school = this.serviceLocator.getSchoolService().getSchool(course.getSchool(), locale);
    Provider provider = this.serviceLocator.getProviderService().getProviderById(course.getProvider(), locale);
   
    // Territorial data
    String townName = school.getContactInfo() != null &&
      school.getContactInfo().getCity() != null ?
      school.getContactInfo().getCity() : "";
   
    List<Town> towns = this.serviceLocator.getTerritorialService().
      findTownsByName(townName, locale);
   
    Town town = new Town();
    Province province = new Province();
    Region region = new Region();
    if(towns != null && towns.size() > 0) {
      town = towns.get(0);
      region = this.serviceLocator.getTransversalService().getRegionsMap().get(locale.getLanguage()).get(town.getRegion());
      province = this.serviceLocator.getTransversalService().getProvincesMap().get(locale.getLanguage()).get(town.getProvince());
    }           
    CourseCatalog catalog = new CourseCatalog(course, locale.getLanguage(),
      school, provider.getName(), province.getName(), region.getName(), town.getName());
   
    CourseCatalog catalogOld =
      this.serviceLocator.getCatalogService().getCourseCatalogByCourseId(course.getId(), locale);
   
    if(catalogOld != null) {
View Full Code Here

   * MANAGEMENT
   */
  @RequestMapping(value="/management/delete/provider/{providerId}", method=RequestMethod.GET)
  public String deleteProvider(@PathVariable Long providerId, Locale locale) throws Exception {
    try {
      Provider provider = this.serviceLocator.getProviderService().getProviderById(providerId, locale);
      if(provider != null) {
        this.serviceLocator.getProviderService().deleteProvider(provider, locale);
      }
     
    } catch(Exception e) {
View Full Code Here

  @RequestMapping(value="/catalog/schools", method=RequestMethod.GET)
  public String getSchools(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 : "name";
      Provider provider =
        this.serviceLocator.getTransversalService().getProviderByUserName(currentUser.getName(), locale);
      model.addAttribute("provider", provider);
      PageManager<School> paginator = new PageManager<School>();
      paginator.setUrlBase("/" + locale.getLanguage() + "/dashboard/mediator/catalog/schools");
      paginator.setStart((page-1)*paginator.getOffset());
      paginator.setSize(this.serviceLocator.getSchoolService().countSchoolsByProvider(provider.getId()));
      paginator.setCollection(this.serviceLocator.getSchoolService().getSchoolsByProvider(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

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.