Package it.hotel.model.gallery

Examples of it.hotel.model.gallery.Gallery


  protected Map referenceData (HttpServletRequest req) throws Exception{
    Map map = new HashMap ();
    User user = userContainer.getUser();
    int hotelId = user.getStructureId();
    Structure hotel = (Structure) structureManager.get(hotelId);
        Gallery gallery = (Gallery) galleryManager.get(hotel.getGallery().getId());
    Set<Photo> photos = gallery.getPhotos();
    map.put("hotel", hotel);
    map.put("photos", photos);
    return map;
  }
View Full Code Here


    Image imageUrl      = null;
    int height         = -1;
    int width         = -1;
    int heightUrl       = -1;
    int widthUrl      = -1;
    Gallery gallery     = null;
    String namePhoto     = null;
    String baseUrlPhoto    = null;
   
    Photo photo = (Photo) command;
 
View Full Code Here

      else{
        photo.setLocale(oldLocale);
      }
      localeContainer.setLocale(oldLocale);
      ModelAndView mav = new ModelAndView("hotel.photo.new");;
      Gallery gallery = (Gallery)galleryManager.get(photo.getGallery().getId());
      mav.addObject("photo", photo);
      mav.addObject("photos", gallery.getPhotos());
      return mav;
    }
    return new ModelAndView("redirect:/photo/new.htm");   
  }
View Full Code Here

 
 
    public void setUpPhoto() {
   
    photo = new Photo();
    Gallery gallery = new Gallery ();
    photo.setGallery(gallery);
   
   
  }
View Full Code Here

 
 
 
    public void setUpGallery() {
   
       gallery = new Gallery();
   
   
  }
View Full Code Here

 
  public Photo setUpPhotos() {


    Photo photo = new Photo();
    Gallery gallery = new Gallery ();
    galleryRawManager.add(gallery);
    photo.setDescription("description");
    photo.setGallery(gallery);
    return photo;
       
View Full Code Here

  }
 
  public void testDeletePhoto() {
   
    Photo photo = setUpPhotos();
    Gallery gallery = new Gallery();
   
    galleryRawManager.add(gallery);
   
    photo.setGallery(gallery);
   
    gallery.addNewPhoto(photo);
   
    photoRawManager.add(photo);
   
    Collection<Photo> photos = photoRawManager.getAll();
   
    assertNotNull(photos);
   
    gallery.deletePhoto(photo);
   
    photoRawManager.remove(photo.getId());
 
    photos = photoRawManager.getAll();
   
View Full Code Here

  public void testGallery() {
   
   
    Collection<Photo> photos = setUpPhotos();
   
    Gallery gallery = new Gallery();
   
    photoRawManager.add(photo1);
    photoRawManager.add(photo2);
   
    gallery.setPhotos((Set) photos);
   
    galleryRawManager.add(gallery);
   
    Gallery gallery2 = (Gallery) galleryRawManager.get(gallery.getId());
   
    assertEquals(gallery, gallery2);
   
    galleryRawManager.remove(gallery);
   
    Gallery gallery3 = (Gallery) galleryRawManager.get(gallery.getId());
 
   
    assertNull(gallery3);
   
   
View Full Code Here

 
  public void testGetAllPhotos() {
   
    Photo photo = setUpPhotos();
   
    Gallery gallery = new Gallery();
   
    galleryRawManager.add(gallery);
    photo.setGallery(gallery);
   
    gallery.addNewPhoto(photo);
   
    photoRawManager.add(photo);
   
    Collection<Photo> photosByGallery = gallery.getPhotos();
   
    Collection<Photo> photos = photoRawManager.getAll();
   
    assertTrue(photos.contains(photo));
    assertTrue(photos.size()==1);
    assertTrue(gallery.getPhotos().size()==1);
    assertTrue(gallery.getPhotos().contains(photo));
   
    assertEquals(photos.size(), photosByGallery.size());
    assertTrue(gallery.getPhotos().contains(photo));
   
  }
View Full Code Here

   
    localizedHotelManager.add(hotel1);
     
    Hotel hotel2= (Hotel) localizedHotelManager.get(hotel1.getId());
   
    Gallery gallery1 = (Gallery) galleryRawManager.get(hotel1.getGallery().getId());
   
    assertEquals(gallery1.getId(), hotel1.getGallery().getId());
   
    assertEquals(hotel2, hotel1);
   
    assertEquals(gallery1.getStructure().getId(), hotel1.getId());
   
     
  }
View Full Code Here

TOP

Related Classes of it.hotel.model.gallery.Gallery

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.