Package com.m4f.business.domain

Examples of com.m4f.business.domain.School


  @Secured({"ROLE_AUTOMATIC_MEDIATOR","ROLE_ADMIN"})
  @RequestMapping(value="/{schoolId}/courses", method=RequestMethod.GET)
  public String getCourses(@PathVariable Long schoolId,  Model model, Locale locale,
      @RequestParam(defaultValue="1", required=false) Integer page) {
    try {
      School school = this.serviceLocator.getSchoolService().getSchool(schoolId, locale);
      model.addAttribute("school", school);
      PageManager<Course> paginator = new PageManager<Course>();
      paginator.setOffset(this.getPageSize());
      paginator.setUrlBase("/" + locale.getLanguage()+ "/course/list");
      paginator.setStart((page-1)*paginator.getOffset());
 
View Full Code Here


  @Secured({"ROLE_AUTOMATIC_MEDIATOR","ROLE_ADMIN"})
  @RequestMapping(value="/{schoolId}/dumps", method=RequestMethod.GET)
  public String getDumps(@PathVariable Long schoolId,  Model model, Locale locale,
      @RequestParam(defaultValue="1", required=false) Integer page) {
    try {
      School school = this.serviceLocator.getSchoolService().getSchool(schoolId, locale);
      if(school == null) {
        Exception e = new Exception("School with id " + schoolId + " doesn't exist.");
        return this.viewHelper.errorManagement(e);
      }
      model.addAttribute("school", 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() : "";
     

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

      Town town = this.serviceLocator.getTerritorialService().getTownsMap(locale).get(townName);
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();
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

   
    @Override
    public void startElement(String uri, String localName, String qName,
        Attributes attributes) throws SAXException {
      if(SCHOOL.equals(qName)) {
        this.school = new School();
        this.info = new ContactInfo();
        this.school.setProvider(provider.getId());
      }
      this.sb.delete(0, this.sb.length());
    }
View Full Code Here

 
  private void selectiveSchoolStore(School newSchool, Locale locale)
      throws NotSameClassException, Exception
      newSchool.setCreated(Calendar.getInstance(new Locale("es")).getTime());
      newSchool.setUpdated(newSchool.getCreated());
      School oldSchool;
      oldSchool = this.schoolService.getSchoolByExternalId(newSchool.getExternalId(), locale);
      if(oldSchool == null) {
        // Creacion de un centro nuevo.
        LOGGER.info("Adding new school: " + newSchool.getName());
        this.entities.add(newSchool);
      } else {
        // Actualizacion de un centro existente.
        // Logica de actualizacion
        SchoolComparator comparator = new SchoolComparator();
        if(comparator.compare(newSchool, oldSchool) == 0) {
          LOGGER.info("Existing school but NOT MODIFIED");
          return;
        }
        LOGGER.severe("Existing school but MODIFIED");
        Set<String> properties = new HashSet<String>();
        properties.add("telephone");
        properties.add("fax");
        properties.add("zipCode");
        properties.add("webSite");
        properties.add("streetAddress");
        properties.add("city");
        properties.add("email");
        this.beanManager.mergeObjects(newSchool.getContactInfo(),
            oldSchool.getContactInfo(), properties);
        properties = new HashSet<String>();
        properties.add("externalId");
        properties.add("name");
        properties.add("feed");
        this.beanManager.mergeObjects(newSchool, oldSchool, properties);
        //newSchool.setId(oldSchool.getId());
        //newSchool.setCreated(oldSchool.getCreated());
        oldSchool.setUpdated(Calendar.getInstance(new Locale("es")).getTime());
        //newSchool.setUpdated(oldSchool.getUpdated());
        this.entities.add(oldSchool);
      }
    }
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);
View Full Code Here

TOP

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

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.