Examples of Photo


Examples of facebook4j.Photo

            JSONArray list = json.getJSONArray("data");
            final int size = list.length();
            ResponseList<Photo> photos = new ResponseListImpl<Photo>(size, json);
            for (int i = 0; i < size; i++) {
                JSONObject photoJSONObject = list.getJSONObject(i);
                Photo photo = new PhotoJSONImpl(photoJSONObject);
                if (conf.isJSONStoreEnabled()) {
                    DataObjectFactoryUtil.registerJSONObject(photo, photoJSONObject);
                }
                photos.add(photo);
            }
View Full Code Here

Examples of fing.satode.com.reveregroup.carousel.client.Photo

        photosDespues=new ArrayList<Photo>();
        
        for(FotoDTO foto:parcelaDTO.getFotos()){
          if(foto.isAntes()){
            new PreloadedImage("/ImageServer.image?id="+foto.getId(), showImageFotosAntes);
            Photo photo = new Photo("/ImageServer.image?id="+foto.getId());
            photo.setHeight(50);
            photo.setWidth(50);
            photo.setCaption(foto.getNombre());
            photosAntes.add(photo);
            cantFotosAntes++;
          }else{
            new PreloadedImage("/ImageServer.image?id="+foto.getId(), showImageFotosDespues);
            Photo photo = new Photo("/ImageServer.image?id="+foto.getId());
            photo.setHeight(50);
            photo.setWidth(50);
            photo.setCaption(foto.getNombre());
            photosDespues.add(photo);
            cantFotosDespues++;
          }
        }
        /*if(photosAntes.size()>0){
 
View Full Code Here

Examples of info.galleria.domain.Photo

  {
    //Setup
    Album album = new Album(TEST_ALBUM_NAME, TEST_ALBUM_DESCRIPTION);
    User user = new User(TEST_USER_ID , TEST_PASSWORD);
    user.addToAlbums(album);
    Photo photo = new Photo(TEST_PHOTO_NAME, TEST_PHOTO_CONTENT);
    photo.setUploadTime(new Date());
    for(Album anAlbum: user.getAlbums())
    {
      if(anAlbum.equals(album))
      {
        anAlbum.addToPhotos(photo);
      }
    }
    em.persist(user);
    long albumId = album.getAlbumId();
    long photoId = photo.getPhotoId();
   
    em.flush();
    em.clear();
   
    //Execute
    user.removeFromAlbums(album);
    user = repository.modify(user);
    em.flush();
    em.clear();
   
    //Verify
    User actualUser = em.find(User.class, TEST_USER_ID);
    Album actualAlbum =  em.find(Album.class, albumId);
    Photo actualPhoto =  em.find(Photo.class, photoId);
    assertEquals(user, actualUser);
    assertFalse(actualUser.getAlbums().contains(album));
    assertNull(actualAlbum);
    assertNull(actualPhoto);
  }
View Full Code Here

Examples of it.hotel.model.photo.Photo

    int widthUrl      = -1;
    Gallery gallery     = null;
    String namePhoto     = null;
    String baseUrlPhoto    = null;
   
    Photo photo = (Photo) command;
 
    if (photo.getImage().length != 0){
      image=Toolkit.getDefaultToolkit().createImage(photo.getImage());
     
      int h=image.getHeight(null);
      int w=image.getWidth(null);
     
      
      long startTime = System.currentTimeMillis();
       int numberPhoto=Toolkit.getDefaultToolkit().checkImage(image, w, h,null );
      while(h==-1 || w==-1 || (numberPhoto < 8) )
      {
         h=image.getHeight(null);
         w=image.getWidth(null);
         numberPhoto=Toolkit.getDefaultToolkit().checkImage(image, w, h,null );
         long endTime = System.currentTimeMillis();
         if((endTime-startTime)>3000){
           h=100;
           w=100;
           numberPhoto=100;
         }
      }
   
    HttpSession session = null;
    session = request.getSession();
    ServletContext context = session.getServletContext();
    String path = context.getRealPath("/");
    namePhoto = java.util.UUID.randomUUID().toString();
    photo.setName(namePhoto);
    User user = userContainer.getUser();
    int hotelId = user.getStructureId();
    Structure hotel = (Structure) structureManager.get(hotelId);
    ImageUtils.upload(namePhoto, path, image, hotelId, hotelId, 400, 400, "big");
    baseUrlPhoto =ImageUtils.upload(namePhoto, path, image, hotelId, hotelId, 50, 50, "small");
    photo.setUrl(baseUrlPhoto);
    photo.setGallery(hotel.getGallery());
   
    String locale = localeContainer.getLocale();
   
    String photoLocale = (String) request.getParameter("locale");
   
    if (!photoLocale.isEmpty())
    {
      photo.setLocale(photoLocale);
    }
    else
    {
      photo.setLocale(locale);
    }
   
    localeContainer.setLocale(photo.getLocale());
   
    photoManager.add(photo);
   
    localeContainer.setLocale(locale);
   
View Full Code Here

Examples of it.hotel.model.photo.Photo

   * @param resp
   * @return
   */
  public ModelAndView delete(HttpServletRequest req, HttpServletResponse resp) {
    String id = req.getParameter("id");
    Photo photo = (Photo)photoManager.get(Integer.parseInt(id));
    photoManager.remove(Integer.parseInt(id));
    HttpSession session = null;
    session = req.getSession();
    ServletContext context = session.getServletContext();
    String path = context.getRealPath("/");
    DirectoryUtils.deleteFile(path + photo.getUrl() + "/small/" + photo.getName() + ".jpeg");
    DirectoryUtils.deleteFile(path + photo.getUrl() + "/big/" + photo.getName() + ".jpeg");
    return new ModelAndView("redirect:/photo/new.htm");
    }
View Full Code Here

Examples of it.hotel.model.photo.Photo

    allFacilities.add(f1);
    allFacilities.add(f2);
    return allFacilities;
  }
  public  List<Photo> getAllPhotos(){
    Photo p1 = new Photo();
    p1.setId(1);
    p1.setDescription("Description1");
    Photo p2 = new Photo ();
    p2.setId(2);
    p2.setDescription("DEscription2");
    List<Photo> allPhotos = new ArrayList<Photo> ();
    allPhotos.add(p1);
    allPhotos.add(p2);
    return allPhotos;
  }
View Full Code Here

Examples of it.hotel.model.photo.Photo

    if (id != null){
      if (locale != null){
        localeContainer.setLocale(locale);
      }
      Photo photo = (Photo) photoManager.get(Integer.parseInt(id));
      if (locale != null){
        photo.setLocale(locale);
      }
      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

Examples of it.hotel.model.photo.Photo

    String locale = req.getParameter("locale");
    if (id != null){
      if (locale != null){
        localeContainer.setLocale(locale);
      }
      Photo photo = (Photo)photoManager.get(Integer.parseInt(id));
      photo.setDescription(description);
      photoManager.add(photo);
      localeContainer.setLocale(oldLocale);
      return new ModelAndView("redirect:/photo/new.htm");
    }
    return new ModelAndView("redirect:/photo/new.htm")
View Full Code Here

Examples of models.Photo

    request = newRequest();
    request.cookies.putAll(cookies);
    response =  POST(request, "/api/me/photos", parameters, files);
    String location = response.getHeader("location");
    assertNotNull(location);
    Photo photo = JsonParserHelper.toPhoto(response.out.toByteArray());
    assertTrue("El propietario de la foto tiene que ser Eva perez.", photo.owner.username.equals(from));
   
    //Se verifica que Juan Gomez a subida una imagen a batzen
    request = newRequest();
    request.cookies.putAll(cookies);
View Full Code Here

Examples of models.Photo

    request = newRequest();
        request.cookies.putAll(cookies);
    response =  POST(request, "/api/me/photos", parameters, files);
    String location = response.getHeader("location");
    assertNotNull(location);
    Photo photo = JsonParserHelper.toPhoto(response.out.toByteArray());
    assertTrue("El propietario de la foto tiene que ser Juan Gomez.", photo.owner.username.equals(from));
   
    //Se verifica que Juan Gomez a subida una imagen a batzen
    request = newRequest();
        request.cookies.putAll(cookies);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.