com.aetrion.flickr.photos
Class SearchParameters

java.lang.Object
  extended by com.aetrion.flickr.photos.SearchParameters

public class SearchParameters
extends java.lang.Object

Version:
$Id: SearchParameters.java,v 1.20 2009/07/23 20:41:03 x-mago Exp $
Author:
Anthony Eden

Field Summary
static java.lang.ThreadLocal DATE_FORMATS
           
static int DATE_POSTED_ASC
          order argument
static int DATE_POSTED_DESC
          order argument
static int DATE_TAKEN_ASC
          order argument
static int DATE_TAKEN_DESC
          order argument
static int INTERESTINGNESS_ASC
          order argument
static int INTERESTINGNESS_DESC
          order argument
static java.lang.ThreadLocal MYSQL_DATE_FORMATS
           
static int RELEVANCE
          order argument
 
Constructor Summary
SearchParameters()
           
 
Method Summary
 int getAccuracy()
           
 java.util.Collection getAsParameters()
           
 java.lang.String[] getBBox()
           
 java.lang.String getContacts()
           
 java.lang.String getGroupId()
           
 boolean getHasGeo()
           
 java.util.Date getInterestingnessDate()
           
 java.lang.String getLatitude()
           
 java.lang.String getLicense()
           
 java.lang.String getLongitude()
           
 java.lang.String getMachineTagMode()
           
 java.lang.String[] getMachineTags()
           
 java.util.Date getMaxTakenDate()
           
 java.util.Date getMaxUploadDate()
           
 java.lang.String getMedia()
           
 java.util.Date getMinTakenDate()
           
 java.util.Date getMinUploadDate()
           
 java.lang.String getPlaceId()
           
 int getRadius()
           
 java.lang.String getRadiusUnits()
           
 java.lang.String getSafeSearch()
           
 int getSort()
           
 java.lang.String getTagMode()
           
 java.lang.String[] getTags()
           
 java.lang.String getText()
           
 java.lang.String getUserId()
           
 java.lang.String getWoeId()
           
 void setAccuracy(int accuracy)
          Optional to use, if BBox is set.
 void setBBox(java.lang.String minimum_longitude, java.lang.String minimum_latitude, java.lang.String maximum_longitude, java.lang.String maximum_latitude)
          4 values defining the Bounding Box of the area that will be searched.
 void setContacts(java.lang.String contacts)
          Search your contacts.
 void setExtras(java.util.Set extras)
          List of extra information to fetch for each returned record.
 void setGroupId(java.lang.String groupId)
          The id of a group who's pool to search.
 void setHasGeo(boolean hasGeo)
          Any photo that has been geotagged.
 void setInterestingnessDate(java.util.Date intrestingnessDate)
          Set the date, for which interesting Photos to request.
 void setLatitude(java.lang.String lat)
           
 void setLicense(java.lang.String license)
           
 void setLongitude(java.lang.String lon)
           
 void setMachineTagMode(java.lang.String tagMode)
          Set the machine tags search mode to use when requesting photos
 void setMachineTags(java.lang.String[] tags)
          Set the machine tags, for which Photos to request.
 void setMaxTakenDate(java.util.Date maxTakenDate)
           
 void setMaxUploadDate(java.util.Date maxUploadDate)
           
 void setMedia(java.lang.String media)
          Filter results by media type.
 void setMinTakenDate(java.util.Date minTakenDate)
           
 void setMinUploadDate(java.util.Date minUploadDate)
           
 void setPlaceId(java.lang.String placeId)
          PlaceId only used when bbox not set.
 void setRadius(int r)
           
 void setRadiusUnits(java.lang.String units)
           
 void setSafeSearch(java.lang.String level)
          Optional safe search setting.
 void setSort(int order)
          Set the sort-order.
 void setTagMode(java.lang.String tagMode)
           
 void setTags(java.lang.String[] tags)
           
 void setText(java.lang.String text)
           
 void setUserId(java.lang.String userId)
           
 void setWoeId(java.lang.String woeId)
          A Where on Earth identifier to use to filter photo clusters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_FORMATS

public static final java.lang.ThreadLocal DATE_FORMATS

MYSQL_DATE_FORMATS

public static final java.lang.ThreadLocal MYSQL_DATE_FORMATS

DATE_POSTED_DESC

public static int DATE_POSTED_DESC
order argument


DATE_POSTED_ASC

public static int DATE_POSTED_ASC
order argument


DATE_TAKEN_DESC

public static int DATE_TAKEN_DESC
order argument


DATE_TAKEN_ASC

public static int DATE_TAKEN_ASC
order argument


INTERESTINGNESS_DESC

public static int INTERESTINGNESS_DESC
order argument


INTERESTINGNESS_ASC

public static int INTERESTINGNESS_ASC
order argument


RELEVANCE

public static int RELEVANCE
order argument

Constructor Detail

SearchParameters

public SearchParameters()
Method Detail

setAccuracy

public void setAccuracy(int accuracy)
Optional to use, if BBox is set.

Defaults to maximum value if not specified.

Parameters:
accuracy - from 1 to 16
See Also:
Flickr.ACCURACY_WORLD, Flickr.ACCURACY_COUNTRY, Flickr.ACCURACY_REGION, Flickr.ACCURACY_CITY, Flickr.ACCURACY_STREET

getAccuracy

public int getAccuracy()

getGroupId

public java.lang.String getGroupId()

setGroupId

public void setGroupId(java.lang.String groupId)
The id of a group who's pool to search. If specified, only matching photos posted to the group's pool will be returned.

Parameters:
groupId -

setHasGeo

public void setHasGeo(boolean hasGeo)
Any photo that has been geotagged.

Geo queries require some sort of limiting agent in order to prevent the database from crying. This is basically like the check against "parameterless searches" for queries without a geo component.

A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters &emdash; If no limiting factor is passed flickr will return only photos added in the last 12 hours (though flickr may extend the limit in the future).

Parameters:
hasGeo -

getHasGeo

public boolean getHasGeo()

getTags

public java.lang.String[] getTags()

setTags

public void setTags(java.lang.String[] tags)

getTagMode

public java.lang.String getTagMode()

setTagMode

public void setTagMode(java.lang.String tagMode)

getText

public java.lang.String getText()

setText

public void setText(java.lang.String text)

getMinUploadDate

public java.util.Date getMinUploadDate()

setMinUploadDate

public void setMinUploadDate(java.util.Date minUploadDate)

getMaxUploadDate

public java.util.Date getMaxUploadDate()

setMaxUploadDate

public void setMaxUploadDate(java.util.Date maxUploadDate)

getMinTakenDate

public java.util.Date getMinTakenDate()

setMinTakenDate

public void setMinTakenDate(java.util.Date minTakenDate)

getMaxTakenDate

public java.util.Date getMaxTakenDate()

setMaxTakenDate

public void setMaxTakenDate(java.util.Date maxTakenDate)

getLicense

public java.lang.String getLicense()

setLicense

public void setLicense(java.lang.String license)

getInterestingnessDate

public java.util.Date getInterestingnessDate()

setInterestingnessDate

public void setInterestingnessDate(java.util.Date intrestingnessDate)
Set the date, for which interesting Photos to request.

Parameters:
intrestingnessDate -

setMachineTags

public void setMachineTags(java.lang.String[] tags)
Set the machine tags, for which Photos to request.

Parameters:
tags -

getMachineTags

public java.lang.String[] getMachineTags()

setMachineTagMode

public void setMachineTagMode(java.lang.String tagMode)
Set the machine tags search mode to use when requesting photos

Parameters:
tagMode -

getMachineTagMode

public java.lang.String getMachineTagMode()

setExtras

public void setExtras(java.util.Set extras)
List of extra information to fetch for each returned record. Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format, last_update, geo, tags, machine_tags, o_dims, views, media, path_alias, url_sq, url_t, url_s, url_m, url_l, url_o

Parameters:
extras - A set of extra-attributes
See Also:
Extras.ALL_EXTRAS, Extras.MIN_EXTRAS

setBBox

public void setBBox(java.lang.String minimum_longitude,
                    java.lang.String minimum_latitude,
                    java.lang.String maximum_longitude,
                    java.lang.String maximum_latitude)
4 values defining the Bounding Box of the area that will be searched.

The 4 values represent the bottom-left corner of the box and the top-right corner, minimum_longitude, minimum_latitude, maximum_longitude, maximum_latitude.

Longitude has a range of -180 to 180, latitude of -90 to 90. Defaults to -180, -90, 180, 90 if not specified.

Unlike standard photo queries, geo (or bounding box) queries will only return 250 results per page.

Geo queries require some sort of limiting agent in order to prevent the database from crying. This is basically like the check against "parameterless searches" for queries without a geo component.

A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters. If no limiting factor is passed flickr returns only photos added in the last 12 hours (though flickr may extend the limit in the future).

Parameters:
minimum_longitude -
minimum_latitude -
maximum_longitude -
maximum_latitude -

getBBox

public java.lang.String[] getBBox()

setSafeSearch

public void setSafeSearch(java.lang.String level)
Optional safe search setting.
Un-authed calls can only see Safe content.

Parameters:
level - 1, 2 or 3
See Also:
Flickr.SAFETYLEVEL_SAFE, Flickr.SAFETYLEVEL_MODERATE, Flickr.SAFETYLEVEL_RESTRICTED

getSafeSearch

public java.lang.String getSafeSearch()

getSort

public int getSort()

setSort

public void setSort(int order)
Set the sort-order.

The default is DATE_POSTED_DESC

Parameters:
order -
See Also:
DATE_POSTED_ASC, DATE_POSTED_DESC, DATE_TAKEN_ASC, DATE_TAKEN_DESC, INTERESTINGNESS_ASC, INTERESTINGNESS_DESC, RELEVANCE

getPlaceId

public java.lang.String getPlaceId()
Returns:
A placeId
See Also:
PlacesInterface.resolvePlaceId(String)

setPlaceId

public void setPlaceId(java.lang.String placeId)
PlaceId only used when bbox not set. Geo queries require some sort of limiting agent in order to prevent the database from crying. This is basically like the check against "parameterless searches" for queries without a geo component.

A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters &emdash; If no limiting factor is passed we return only photos added in the last 12 hours (though we may extend the limit in the future).

Parameters:
placeId -
See Also:
PlacesInterface.resolvePlaceId(String), Place.getPlaceId(), Location.getPlaceId()

getWoeId

public java.lang.String getWoeId()

setWoeId

public void setWoeId(java.lang.String woeId)
A Where on Earth identifier to use to filter photo clusters.
For example all the photos clustered by locality in the United States (WOE ID 23424977).
(not used if bbox argument is present).

Geo queries require some sort of limiting agent in order to prevent the database from crying. This is basically like the check against "parameterless searches" for queries without a geo component.

A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters. If no limiting factor is passed we return only photos added in the last 12 hours (though flickr may extend the limit in the future).

Parameters:
woeId -
See Also:
Place.getWoeId(), Location.getWoeId()

getMedia

public java.lang.String getMedia()

setMedia

public void setMedia(java.lang.String media)
              throws FlickrException
Filter results by media type. Possible values are all (default), photos or videos.

Parameters:
media -
Throws:
FlickrException

getContacts

public java.lang.String getContacts()

setContacts

public void setContacts(java.lang.String contacts)
Search your contacts. Valid arguments are either 'all' or 'ff' for just friends and family.

It requires that the "user_id" field also be set and allows you to limit queries to only photos belonging to that user's photos. As in : All my contacts photos tagged "aaron". (Experimental)

Parameters:
contacts -

getAsParameters

public java.util.Collection getAsParameters()

setLatitude

public void setLatitude(java.lang.String lat)

setRadius

public void setRadius(int r)

setLongitude

public void setLongitude(java.lang.String lon)

setRadiusUnits

public void setRadiusUnits(java.lang.String units)

getLatitude

public java.lang.String getLatitude()

getLongitude

public java.lang.String getLongitude()

getRadius

public int getRadius()

getRadiusUnits

public java.lang.String getRadiusUnits()

getUserId

public java.lang.String getUserId()

setUserId

public void setUserId(java.lang.String userId)


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