Package com.google.gdata.data.photos

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


  }
 
  @Override
  public ServiceResponse addAlbum(String title) {
    try {
      AlbumEntry myAlbum = new AlbumEntry();
      myAlbum.setTitle(new PlainTextConstruct(title));
      myAlbum.setDescription(new PlainTextConstruct(title));
      getBusiness().getPicasaBusiness().addAlbum(myAlbum);
      return ServiceResponse.createSuccessResponse(
          Messages.get("success"));
    }
    catch (Exception e) {
View Full Code Here


  }

  @Override
  public PhotoEntry upload(String albumId, byte[] data, String name)
      throws MalformedURLException, IOException, ServiceException {
    AlbumEntry album = findAlbum(albumId);
    if (album == null) {
      throw new IllegalArgumentException(Messages.get("album_not_found",
          albumId));
    }
    PhotoEntry photo = new PhotoEntry();
View Full Code Here

  }

  public String createAlbum(String title, String description, boolean privateAlbum) {
    LOG.info(String.format("Attempting to create %s Picasa album...",
        privateAlbum ? "private" : "public"));
    AlbumEntry album = new AlbumEntry();

    if (privateAlbum) {
      album.setAccess(GphotoAccess.Value.PRIVATE);
    } else {
      album.setAccess(GphotoAccess.Value.PUBLIC);
    }

    album.setTitle(new PlainTextConstruct(title));
    album.setDescription(new PlainTextConstruct(description));

    try {
      AlbumEntry albumEntry = service.insert(new URL(USER_FEED_URL), album);
      String albumUrl = albumEntry.getFeedLink().getHref();
      LOG.info(String.format("Created %s Picasa album: %s",
          privateAlbum ? "private" : "public", albumUrl));

      return albumUrl;
    } catch (MalformedURLException e) {
View Full Code Here

   
    return returnedPhoto;
  }
 
  public AlbumEntry insert(AlbumEntry albumEntry) {
    AlbumEntry insertedAlbumEntry = null;
    try {
      insertedAlbumEntry = service.insert(this.getFeedUrl(), albumEntry);
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

    }
    return insertedAlbumEntry;
  }
 
  public AlbumEntry createAlbum(String blogTitle) {
    AlbumEntry myAlbum = new AlbumEntry();
    myAlbum.setTitle(new PlainTextConstruct(blogTitle));
    AlbumEntry insertedAlbumEntry = this.insert(myAlbum);
    return insertedAlbumEntry;
  }
View Full Code Here

  public AlbumEntry findCorrespondingPicasaAlbum(
      String blogName,
      UserFeed picasaAlbumList
      ) {
    AlbumEntry foundAlbum = null;
    for (AlbumEntry myAlbum : picasaAlbumList.getAlbumEntries()) {
      if(myAlbum.getTitle().getPlainText().compareTo(blogName) == 0) {
        foundAlbum = myAlbum;
        System.out.println("Album Name: " + myAlbum.getTitle().getPlainText());
      }
View Full Code Here

  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);
    }

    return photoService.insert(new URL(PWA_API_PREFIX + "default"), myPhoto);

  }
View Full Code Here

  private void showUserTags() throws Exception {
    printTags(getTags());
  }

  private void showAlbumTags(List<AlbumEntry> albums) throws Exception {
    AlbumEntry albumEntry;
    try {
      albumEntry = getEntry(albums, "album");
    } catch (ExitException ee) {
      return;
    }
View Full Code Here

    printTags(getTags(albumEntry));
  }

  private void createAlbum() throws Exception {
    AlbumEntry album = new AlbumEntry();

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

    String access = "";
    while (!access.equals("public") && !access.equals("private")) {
      access = getString("Access (public | private)");
    }

    album.setAccess(access);

    String location = getString("Location");
    album.setLocation(location);
    album.setDate(new Date());

    insertAlbum(album);
  }
View Full Code Here

    insert(photoEntry, comment);
  }

  private void showAlbumPhotos(List<AlbumEntry> albums) throws Exception {

    AlbumEntry albumEntry;
    try {
      albumEntry = getEntry(albums, "album");
    } catch (ExitException ee) {
      return;
    }
View Full Code Here

TOP

Related Classes of com.google.gdata.data.photos.AlbumEntry

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.