Examples of PhotoEntry


Examples of com.google.gdata.data.photos.PhotoEntry

    AlbumEntry album = findAlbum(albumId);
    if (album == null) {
      throw new IllegalArgumentException(Messages.get("album_not_found",
          albumId));
    }
    PhotoEntry photo = new PhotoEntry();
    photo.setTitle(new PlainTextConstruct(name));
    MediaSource mediaSource = new MediaByteArraySource(data,
        MimeType.getContentTypeByExt(FolderUtil.getFileExt(name)));
    photo.setMediaSource(mediaSource);
    return getPicasawebService().insert(new URL(getPicasaURL(albumId)),
        photo);
  }
View Full Code Here

Examples of com.google.gdata.data.photos.PhotoEntry

    } catch (MalformedURLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    PhotoEntry myPhoto = new PhotoEntry();
    myPhoto.setClient("NinjaBlogger");

    MediaFileSource myMedia = new MediaFileSource(photo, mediaType);
    myPhoto.setMediaSource(myMedia);

    PhotoEntry returnedPhoto = null;
    try {
      returnedPhoto = service.insert(albumPostUrl, myPhoto);
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

Examples of com.google.gdata.data.photos.PhotoEntry

        allFilesSent = true;
        continue;
      }
      File photo = new File(prefs.getFolderPath()+"\\"+photoName);
      String mediaType = new String("image/jpeg");
      PhotoEntry addedPhoto = picasaServiceHandler.uploadPhoto(album, photo, mediaType);
     
      String photoUrl = addedPhoto.getMediaThumbnails().get(0).getUrl();
      photoUrl = photoUrl.replaceAll("s72", "s640");

      String content = QuickPB.generateContent(photoUrl);
      String title = photoName.split(".jpg")[0];
      bloggerServiceHandler.createPost(prefs.getBlogId(), title, content);
View Full Code Here

Examples of com.google.gdata.data.photos.PhotoEntry

    }
    return documentsService.insert(documentsFeedUri, newEntry);
  }

  public PhotoEntry uploadImage(byte[] mediaBytes, String mediaType, String imageName, String albumName) throws IOException, ServiceException {
    PhotoEntry myPhoto = new PhotoEntry();
    myPhoto.setTitle(new PlainTextConstruct(imageName));
    MediaByteArraySource myMedia = new MediaByteArraySource(mediaBytes, mediaType);
    myPhoto.setMediaSource(myMedia);
    AlbumEntry albumEntry = getAlbum(albumName);
    if (albumEntry != null) {
      return photoService.insert(new URL(((MediaContent) albumEntry.getContent()).getUri()), myPhoto);
    }
View Full Code Here

Examples of com.google.gdata.data.photos.PhotoEntry

      }
    }
  }

  private void createPhoto(AlbumEntry albumEntry) throws Exception {
    PhotoEntry photo = new PhotoEntry();

    String title = getString("Title");
    photo.setTitle(new PlainTextConstruct(title));
    String description = getString("Description");
    photo.setDescription(new PlainTextConstruct(description));
    photo.setTimestamp(new Date());

    OtherContent content = new OtherContent();


    File file = null;
    while (file == null || !file.canRead()) {
      file = new File(getString("Photo location"));
    }
    content.setBytes(getBytes(file));
    content.setMimeType(new ContentType("image/jpeg"));
    photo.setContent(content);

    insert(albumEntry, photo);
  }
View Full Code Here

Examples of com.google.gdata.data.photos.PhotoEntry

    return result;
  }

  private void showPhotoTags(AlbumEntry albumEntry, List<PhotoEntry> photos)
      throws Exception {
    PhotoEntry photoEntry;
    try {
      photoEntry = getEntry(photos, "photo");
    } catch (ExitException ee) {
      return;
    }
View Full Code Here

Examples of com.google.gdata.data.photos.PhotoEntry

  }

  private void showPhotoComments(AlbumEntry albumEntry, List<PhotoEntry> photos)
      throws Exception {

    PhotoEntry photoEntry;
    try {
      photoEntry = getEntry(photos, "photo");
    } catch (ExitException ee) {
      return;
    }
View Full Code Here

Examples of com.google.ytd.model.PhotoEntry

  }

  @Override
  public void deletePhotoEntry(String id) {
    PersistenceManager pm = pmf.getPersistenceManager();
    PhotoEntry entry = null;
    try {
      entry = pm.getObjectById(PhotoEntry.class, id);

      // Update the photo count of the corresponding submission
      PhotoSubmission photoSubmission = this.getSubmissionById(entry.getSubmissionId());
      photoSubmission.setNumberOfPhotos(photoSubmission.getNumberOfPhotos() - 1);
      this.save(photoSubmission);

      BlobKey blobKey = entry.getBlobKey();
      if (blobKey != null) {
        // Delete the image binary from blob store
        BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
        blobstoreService.delete(blobKey);
      }
View Full Code Here

Examples of com.google.ytd.model.PhotoEntry

  }

  @Override
  public PhotoEntry getPhotoEntry(String id) {
    PersistenceManager pm = pmf.getPersistenceManager();
    PhotoEntry entry = null;

    try {
      entry = pm.getObjectById(PhotoEntry.class, id);
    } finally {
      pm.close();
View Full Code Here

Examples of com.google.ytd.model.PhotoEntry

        String submissionId = photoSubmission.getId();

        for (BlobKey blobKey : validSubmissionKeys) {
          BlobInfo blobInfo = blobInfoFactory.loadBlobInfo(blobKey);

          PhotoEntry photoEntry = new PhotoEntry(submissionId, blobKey, blobInfo.getContentType());
          photoEntry.setOriginalFileSize(blobInfo.getSize());
          photoEntry.setOriginalFileName(blobInfo.getFilename());
         
          pmfUtil.persistJdo(photoEntry);
        }
       
        Queue queue = QueueFactory.getDefaultQueue();
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.