com.aetrion.flickr.photosets
Class PhotosetsInterface

java.lang.Object
  extended by com.aetrion.flickr.photosets.PhotosetsInterface

public class PhotosetsInterface
extends java.lang.Object

Interface for working with photosets.

Version:
$Id: PhotosetsInterface.java,v 1.26 2009/07/11 20:30:27 x-mago Exp $
Author:
Anthony Eden

Field Summary
static java.lang.String METHOD_ADD_PHOTO
           
static java.lang.String METHOD_CREATE
           
static java.lang.String METHOD_DELETE
           
static java.lang.String METHOD_EDIT_META
           
static java.lang.String METHOD_EDIT_PHOTOS
           
static java.lang.String METHOD_GET_CONTEXT
           
static java.lang.String METHOD_GET_INFO
           
static java.lang.String METHOD_GET_LIST
           
static java.lang.String METHOD_GET_PHOTOS
           
static java.lang.String METHOD_ORDER_SETS
           
static java.lang.String METHOD_REMOVE_PHOTO
           
 
Constructor Summary
PhotosetsInterface(java.lang.String apiKey, java.lang.String sharedSecret, Transport transportAPI)
           
 
Method Summary
 void addPhoto(java.lang.String photosetId, java.lang.String photoId)
          Add a photo to the end of the photoset.
 Photoset create(java.lang.String title, java.lang.String description, java.lang.String primaryPhotoId)
          Create a new photoset.
 void delete(java.lang.String photosetId)
          Delete the specified photoset.
 void editMeta(java.lang.String photosetId, java.lang.String title, java.lang.String description)
          Modify the meta-data for a photoset.
 void editPhotos(java.lang.String photosetId, java.lang.String primaryPhotoId, java.lang.String[] photoIds)
          Edit which photos are in the photoset.
 PhotoContext getContext(java.lang.String photoId, java.lang.String photosetId)
          Get a photo's context in the specified photo set.
 Photoset getInfo(java.lang.String photosetId)
          Get the information for a specified photoset.
 Photosets getList(java.lang.String userId)
          Get a list of all photosets for the specified user.
 PhotoList getPhotos(java.lang.String photosetId, int perPage, int page)
          Convenience method.
 PhotoList getPhotos(java.lang.String photosetId, java.util.Set extras, int privacy_filter, int perPage, int page)
          Get a collection of Photo objects for the specified Photoset.
 void orderSets(java.lang.String[] photosetIds)
          Set the order in which sets are returned for the user.
 void removePhoto(java.lang.String photosetId, java.lang.String photoId)
          Remove a photo from the set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD_ADD_PHOTO

public static final java.lang.String METHOD_ADD_PHOTO
See Also:
Constant Field Values

METHOD_CREATE

public static final java.lang.String METHOD_CREATE
See Also:
Constant Field Values

METHOD_DELETE

public static final java.lang.String METHOD_DELETE
See Also:
Constant Field Values

METHOD_EDIT_META

public static final java.lang.String METHOD_EDIT_META
See Also:
Constant Field Values

METHOD_EDIT_PHOTOS

public static final java.lang.String METHOD_EDIT_PHOTOS
See Also:
Constant Field Values

METHOD_GET_CONTEXT

public static final java.lang.String METHOD_GET_CONTEXT
See Also:
Constant Field Values

METHOD_GET_INFO

public static final java.lang.String METHOD_GET_INFO
See Also:
Constant Field Values

METHOD_GET_LIST

public static final java.lang.String METHOD_GET_LIST
See Also:
Constant Field Values

METHOD_GET_PHOTOS

public static final java.lang.String METHOD_GET_PHOTOS
See Also:
Constant Field Values

METHOD_ORDER_SETS

public static final java.lang.String METHOD_ORDER_SETS
See Also:
Constant Field Values

METHOD_REMOVE_PHOTO

public static final java.lang.String METHOD_REMOVE_PHOTO
See Also:
Constant Field Values
Constructor Detail

PhotosetsInterface

public PhotosetsInterface(java.lang.String apiKey,
                          java.lang.String sharedSecret,
                          Transport transportAPI)
Method Detail

addPhoto

public void addPhoto(java.lang.String photosetId,
                     java.lang.String photoId)
              throws java.io.IOException,
                     org.xml.sax.SAXException,
                     FlickrException
Add a photo to the end of the photoset.

Note: requires authentication with the new authentication API with 'write' permission.

Parameters:
photosetId - The photoset ID
photoId - The photo ID
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

create

public Photoset create(java.lang.String title,
                       java.lang.String description,
                       java.lang.String primaryPhotoId)
                throws java.io.IOException,
                       org.xml.sax.SAXException,
                       FlickrException
Create a new photoset.

Parameters:
title - The photoset title
description - The photoset description
primaryPhotoId - The primary photo id
Returns:
The new Photset
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

delete

public void delete(java.lang.String photosetId)
            throws java.io.IOException,
                   org.xml.sax.SAXException,
                   FlickrException
Delete the specified photoset.

Parameters:
photosetId - The photoset ID
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

editMeta

public void editMeta(java.lang.String photosetId,
                     java.lang.String title,
                     java.lang.String description)
              throws java.io.IOException,
                     org.xml.sax.SAXException,
                     FlickrException
Modify the meta-data for a photoset.

Parameters:
photosetId - The photoset ID
title - A new title
description - A new description (can be null)
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

editPhotos

public void editPhotos(java.lang.String photosetId,
                       java.lang.String primaryPhotoId,
                       java.lang.String[] photoIds)
                throws java.io.IOException,
                       org.xml.sax.SAXException,
                       FlickrException
Edit which photos are in the photoset.

Parameters:
photosetId - The photoset ID
primaryPhotoId - The primary photo Id
photoIds - The photo IDs for the photos in the set
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getContext

public PhotoContext getContext(java.lang.String photoId,
                               java.lang.String photosetId)
                        throws java.io.IOException,
                               org.xml.sax.SAXException,
                               FlickrException
Get a photo's context in the specified photo set. This method does not require authentication.

Parameters:
photoId - The photo ID
photosetId - The photoset ID
Returns:
The PhotoContext
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getInfo

public Photoset getInfo(java.lang.String photosetId)
                 throws FlickrException,
                        java.io.IOException,
                        org.xml.sax.SAXException
Get the information for a specified photoset. This method does not require authentication.

Parameters:
photosetId - The photoset ID
Returns:
The Photoset
Throws:
FlickrException
java.io.IOException
org.xml.sax.SAXException

getList

public Photosets getList(java.lang.String userId)
                  throws java.io.IOException,
                         org.xml.sax.SAXException,
                         FlickrException
Get a list of all photosets for the specified user. This method does not require authentication.

Parameters:
userId - The User id
Returns:
The Photosets collection
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getPhotos

public PhotoList getPhotos(java.lang.String photosetId,
                           java.util.Set extras,
                           int privacy_filter,
                           int perPage,
                           int page)
                    throws java.io.IOException,
                           org.xml.sax.SAXException,
                           FlickrException
Get a collection of Photo objects for the specified Photoset.

Parameters:
photosetId - The photoset ID
extras - Set of extra-fields
privacy_filter - filter value for authenticated calls
perPage - The number of photos per page
page - The page offset
Returns:
PhotoList The Collection of Photo objects
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException
See Also:
Extras, Flickr.PRIVACY_LEVEL_NO_FILTER, Flickr.PRIVACY_LEVEL_PUBLIC, Flickr.PRIVACY_LEVEL_FRIENDS, Flickr.PRIVACY_LEVEL_FRIENDS_FAMILY, Flickr.PRIVACY_LEVEL_FAMILY, Flickr.PRIVACY_LEVEL_FRIENDS

getPhotos

public PhotoList getPhotos(java.lang.String photosetId,
                           int perPage,
                           int page)
                    throws java.io.IOException,
                           org.xml.sax.SAXException,
                           FlickrException
Convenience method. Calls getPhotos() with Extras.MIN_EXTRAS and Flickr.PRIVACY_LEVEL_NO_FILTER. This method does not require authentication.

Parameters:
photosetId - The photoset ID
perPage - The number of photos per page
page - The page offset
Returns:
PhotoList The Collection of Photo objects
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException
See Also:
Extras, Flickr.PRIVACY_LEVEL_NO_FILTER, Flickr.PRIVACY_LEVEL_PUBLIC, Flickr.PRIVACY_LEVEL_FRIENDS, Flickr.PRIVACY_LEVEL_FRIENDS_FAMILY, Flickr.PRIVACY_LEVEL_FAMILY, Flickr.PRIVACY_LEVEL_FRIENDS

orderSets

public void orderSets(java.lang.String[] photosetIds)
               throws java.io.IOException,
                      org.xml.sax.SAXException,
                      FlickrException
Set the order in which sets are returned for the user. This method requires authentication with 'write' permission.

Parameters:
photosetIds - An array of Ids
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

removePhoto

public void removePhoto(java.lang.String photosetId,
                        java.lang.String photoId)
                 throws java.io.IOException,
                        org.xml.sax.SAXException,
                        FlickrException
Remove a photo from the set.

Parameters:
photosetId - The photoset ID
photoId - The photo ID
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException


Copyright (C) 2005-2008 Aetrion LLC. All Rights Reserved.