com.aetrion.flickr.photos.comments
Class CommentsInterface

java.lang.Object
  extended by com.aetrion.flickr.photos.comments.CommentsInterface

public class CommentsInterface
extends java.lang.Object

Work on Comments.

Version:
$Id: CommentsInterface.java,v 1.4 2009/07/11 20:30:27 x-mago Exp $
Author:
till (Till Krech) flickr:extranoise

Field Summary
static java.lang.String METHOD_ADD_COMMENT
           
static java.lang.String METHOD_DELETE_COMMENT
           
static java.lang.String METHOD_EDIT_COMMENT
           
static java.lang.String METHOD_GET_LIST
           
static java.lang.String METHOD_GET_RECENT
           
 
Constructor Summary
CommentsInterface(java.lang.String apiKey, java.lang.String sharedSecret, Transport transport)
           
 
Method Summary
 java.lang.String addComment(java.lang.String photoId, java.lang.String commentText)
          Add comment to a photo as the currently authenticated user.
 void deleteComment(java.lang.String commentId)
          Delete a comment as the currently authenticated user.
 void editComment(java.lang.String commentId, java.lang.String commentText)
          Edit the text of a comment as the currently authenticated user.
 java.util.List getList(java.lang.String photoId)
          Returns the comments for a photo.
 PhotoList getRecentForContacts(java.util.Date lastComment, java.util.ArrayList contactsFilter, java.util.Set extras, int perPage, int page)
          Returns the list of photos belonging to your contacts that have been commented on recently.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD_ADD_COMMENT

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

METHOD_DELETE_COMMENT

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

METHOD_EDIT_COMMENT

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

METHOD_GET_LIST

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

METHOD_GET_RECENT

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

CommentsInterface

public CommentsInterface(java.lang.String apiKey,
                         java.lang.String sharedSecret,
                         Transport transport)
Method Detail

addComment

public java.lang.String addComment(java.lang.String photoId,
                                   java.lang.String commentText)
                            throws java.io.IOException,
                                   org.xml.sax.SAXException,
                                   FlickrException
Add comment to a photo as the currently authenticated user. This method requires authentication with 'write' permission.

Parameters:
photoId - The id of the photo to add a comment to.
commentText - Text of the comment.
Returns:
a unique comment id.
Throws:
org.xml.sax.SAXException
java.io.IOException
FlickrException

deleteComment

public void deleteComment(java.lang.String commentId)
                   throws java.io.IOException,
                          org.xml.sax.SAXException,
                          FlickrException
Delete a comment as the currently authenticated user. This method requires authentication with 'write' permission.

Parameters:
commentId - The id of the comment to delete.
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

editComment

public void editComment(java.lang.String commentId,
                        java.lang.String commentText)
                 throws java.io.IOException,
                        org.xml.sax.SAXException,
                        FlickrException
Edit the text of a comment as the currently authenticated user. This method requires authentication with 'write' permission.

Parameters:
commentId - The id of the comment to edit.
commentText - Update the comment to this text.
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getList

public java.util.List getList(java.lang.String photoId)
                       throws FlickrException,
                              java.io.IOException,
                              org.xml.sax.SAXException
Returns the comments for a photo. This method does not require authentication.

Parameters:
photoId - The id of the photo to fetch comments for.
Returns:
a List of Comment objects.
Throws:
FlickrException
java.io.IOException
org.xml.sax.SAXException

getRecentForContacts

public PhotoList getRecentForContacts(java.util.Date lastComment,
                                      java.util.ArrayList contactsFilter,
                                      java.util.Set extras,
                                      int perPage,
                                      int page)
                               throws FlickrException,
                                      java.io.IOException,
                                      org.xml.sax.SAXException

Returns the list of photos belonging to your contacts that have been commented on recently.

There is an emphasis on the recent part with this method, which is fancy-talk for "in the last hour".

It is not meant to be a general purpose, get all the comments ever, but rather a quick and easy way to bubble up photos that people are talking about ("about") now.

It has the added bonus / side-effect of bubbling up photos a person may have missed because they were uploaded before the photo owner was made a contact or the business of life got in the way.

This method requires authentication with 'read' permission.

Parameters:
lastComment - Limits the resultset to photos that have been commented on since this date. The default, and maximum, offset is (1) hour. Optional, can be null.
contactsFilter - A list of contact NSIDs to limit the scope of the query to. Optional, can be null.
extras - A list of extra information to fetch for each returned record. Optional, can be null.
perPage - The number of photos per page.
page - The page offset.
Returns:
List of photos
Throws:
FlickrException
java.io.IOException
org.xml.sax.SAXException


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